Set row heights to values in cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone provide VBA code to set row heights for a range of rows (say, rows
20-100) to the values in a particular column (say column A)? In other words,
row height for row 1 equals value in cell A1; row height for row 2 equals
value in cell A2, etc. Also, what limit does Excel impose on maximum row
height? Any help would be appreciated.
 
Sub SetHeights()
Dim cell As Range
For Each cell In Range("A1:A20")
cell.EntireRow.RowHeight = cell.Value
Next
End Sub
 
Back
Top