View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
SteveZmyname SteveZmyname is offline
external usenet poster
 
Posts: 30
Default Minimum row height

Hello
How do I go about changing this to run from the macro menu?
The other macros are public so I changed this to public as well, put it in
the module code but it doesn't show up with the other macros?
thanks for your help

"Gord Dibben" wrote:

You may want to have the code an event type so's it will run as you enter.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A10"
Dim cell As Range
Dim iHeight As Long
iHeight = 105

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each cell In Target
With cell
.WrapText = True
If .RowHeight < iHeight Then
.RowHeight = iHeight
End If
End With
Next cell
End If

ws_exit:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code"

Copy/paste the code to that sheet module.

Edit WS_RANGE to suit. Alt + q to return to Excel.


Gord Dibben MS Excel MVP

On Mon, 15 Mar 2010 12:15:02 -0700, Gary Brown
wrote:

Yes, put it in a module.
Then while the workbook containing the function is open, you can run the
macro.


.