Row Height and column Width Property

     

     

  • This property is useful to change the ROW Height and COLUMN Width
  •  

    Private Sub CommandButton1_Click()
    'To change the 5th row height
    Rows(5).RowHeight = 25
    'To change the height of 2nd and 3rd (multiple rows)
    Rows("2:3").RowHeight = 25
    'To change the rows height in defined range
    Range("C4:E6").RowHeight = 25
    'to change the column width in a Range

    Range("C4:E6").ColumnWidth = 11
    'to change the width of column "B"
    Columns("B").ColumnWidth = 8
    'to change width of multiple columns
    Columns("D:H").ColumnWidth = 8
    End Sub
    Private Sub CommandButton2_Click()
    'to change the row height
    Rows(5).RowHeight = StandardHeight
    Rows("2:3").RowHeight = StandardHeight
    Range("C4:E6").RowHeight = StandardHeight
    'to change the column width
    Range("C4:E6").ColumnWidth = StandardWidth
    Columns("B").ColumnWidth = StandardWidth
    Columns("D:H").ColumnWidth = StandardWidth
    End Sub