View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Selah West Selah West is offline
external usenet poster
 
Posts: 10
Default Row Height-expand if text wraps in a cell


Gord,

Thank you for your help! There's only one thing...I have attached two codes,
the one you gave me and I have also used a code which is the following:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 Then
Application.EnableEvents = False
If Target.Value < "" Then
Target.Offset(, 1).Value = Now
Else
Target.Offset(, 1).Value = ""
End If
Application.EnableEvents = True
End If
End Sub

Now, when I type something in my cells, I get this "Microsoft Visual Basic
Compile error: Ambiguous name detected: Worksheet_Change. These code work
individually but not together...any suggestions?


"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Row Autofit will not work with merged cells unless you add event code to
your worksheet.

If you "MUST" use merged cells and you want to go that
route...............

See google search thread for code by Greg Wilson. Watch out for word wrap
in the URL which is all one line.

http://groups.google.com/group/micro...1c160cbeb27874


Gord Dibben MS Excel MVP

On Thu, 25 Jun 2009 10:13:11 -0700, "Selah West"
wrote:

I have merged cells, so it disables Autofit. I would like to know if there
is a way to use atuofit and have merged cells.

"JLGWhiz" wrote in message
...
Maybe on the menu bar click FormatRowAutofit


"Selah West" wrote in message
...
I have a worksheet that has a comments column that is formatted to wrap
text if needed for each cell. My problem is I need the row to
automatically adjust to the height of what ever is entered in that cell.
I
want to be able to use merged cells. Is there a VBA event code to make
this happen?

Using Excel 2007