View Single Post
  #1   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

Hello all

I'm certainly no expert, and I'm trying to botch my way through this
project. Surprise, surprise I got stuck again
I found a macro on the web:

http://excel.tips.net/Pages/T001940_...ell_Value.html

I adjusted it a bit, but it's still not working, can anyone help? I'm
looking for a macro that will hide/unhide rows depending on whether the value
in the N column is "Yes", or "-". If "Yes" then show, if "-" then hide. The
value could change so the macro needs to be able to handle that as well.

Thanks in advance

Sub HideRows()
BeginRow = 51
EndRow = 1354
ChkCol = 14

For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "-" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub