![]() |
Set row heights to values in cells
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. |
Set row heights to values in cells
Sub SetHeights()
Dim cell As Range For Each cell In Range("A1:A20") cell.EntireRow.RowHeight = cell.Value Next End Sub -- Regards, Tom Ogilvy "John" wrote in message ... 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. |
Set row heights to values in cells
Thanks Tom.
"Tom Ogilvy" wrote: Sub SetHeights() Dim cell As Range For Each cell In Range("A1:A20") cell.EntireRow.RowHeight = cell.Value Next End Sub -- Regards, Tom Ogilvy "John" wrote in message ... 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. |
All times are GMT +1. The time now is 02:15 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com