View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Joanne Joanne is offline
external usenet poster
 
Posts: 53
Default Problem with conditional hide/unhide row macro

Socko

Thanks for your help.
I pasted in this macro, but it doesn't seem to work. On the debugger, it has
a problem with "If Target.Column = 14 Then", the error "object required"
comes up.

But even so, the cell that will change is linked to another cell and is NOT
modified manually. It would be a specific change not 'any', so it wouldn't be
the right macro anyway.

Any other suggestions would be very much appreciated

"Socko" wrote:

Since you wanted the flexibility of macro to handle any change as
well, the following code will take care of it. Please insert the
following code to the worksheet codemodule of a given worksheet.
(please be advised that this code will work only if there is any
change in the content of a cell... if the cell links to another cell
and if the related cell is changed, this code wont help).,


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 14 Then
Call HideRows
End If
End Sub


I hope this helps.

Selva V Pasupathy
For more on Excel, VBA, and other resources
Please visit: http://socko.wordpress.com