View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Macro to Unhide MulipleRows if Cell B10 has a "X" otherwise hide c

Hi,

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If UCase(Range("B10")) = "X" Or UCase(Range("B11")) = "X" Then
Rows(15 & ":" & 19).EntireRow.Hidden = False
ElseIf WorksheetFunction.CountA(Range("B10:B11")) = 0 Then
Rows(15 & ":" & 19).EntireRow.Hidden = True
End If
End Sub

Mike

"Leiprecht" wrote:

Trying to create a macro where if Cell B10 or B11 has an "X" then Rows 15-19
are unhiden. If B10 and B11 are both blank then rows 15-19 is hidden.