Last active
December 11, 2017 17:39
-
-
Save ship9599/3ed16a5bec24613998d380b3dd933d69 to your computer and use it in GitHub Desktop.
We can change row height in Excel using RowHeight Property of a Row in VBA. See the following example to do it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub sbAutoAdjustColumnRowWidth() | |
'Auto ColumnFit | |
Columns(2).AutoFit | |
'Auto RowFit | |
Rows(2).AutoFit | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub sbChangeColumnWidth() | |
'Changing Columns B's Width | |
Columns("B").ColumnWidth = 25 | |
'Changing the B-E Column Width | |
Columns("B:E").ColumnWidth = 25 | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub sbChangeRowHeight() | |
'Changing the 3rd row Height | |
Rows(3).RowHeight = 25 | |
'Changing the 3rd-25the row Height | |
Rows("4:25").RowHeight = 25 | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment