Thread: Row Height
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Row Height

The following procedure will make the row height resizing take place
automatically as you enter or remove data in the range C6:C100. Right click
the tab at the bottom of the worksheet you want to have this functionality,
select View Code from the popup menu that appears and then copy/paste the
following code into the code window that appears...

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C6:C100")) Is Nothing Then
If Len(Target.Value) Then
Target.RowHeight = 15
Else
Target.RowHeight = 12.75
End If
End If
End Sub

Now, go back to your work sheet and enter something into any cell in the
range C6:C100 and watch the row height change.... now delete it and watch
the row height return to the default size of 12.75.

--
Rick (MVP - Excel)


"JohnUK" wrote in message
...
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