Thread: Row Height
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ryan H Ryan H is offline
external usenet poster
 
Posts: 489
Default Row Height

You could actually do this too without the loop.

Sub RowSizer()

Dim lngLastRow As Long

lngLastRow = Cells(Rows.Count, "C").End(xlUp).Row

' adjust all row height to 15
Cells.RowHeight = 15

' adjust blank cell rows in Col. C to 12.75
Range("C1:C" & lngLastRow).SpecialCells(xlCellTypeBlanks).RowHeig ht =
12.75

End Sub


Hope this helps! If so, let me know, click "YES" below.
--
Cheers,
Ryan


"JohnUK" wrote:

Hi All,
Can anyone help with this.
Is there a piece of code that will change the height of the Row/Rows if
there is data in columns.

For example:
If I had data from cells C6 through to C100, only those rows would be 15
instead of the default of 12.75. Because the data is forever changing, I
would want the rows to change with it.
Sounds rather pointless I know, but can it be done
Many thanks in advance
Regards
John