Set row heights to values in cells

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.
 
T

Tom Ogilvy

Sub SetHeights()
Dim cell As Range
For Each cell In Range("A1:A20")
cell.EntireRow.RowHeight = cell.Value
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top