View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
CH CH is offline
external usenet poster
 
Posts: 3
Default Macro to hide column based on value on another sheet

I need help with a Macro to hide a column on one sheet with a (yes/no)
value from another sheet.

(So if cell D26 value = Yes then Hide Column H on Sheet named BOY)

Here is the code I am trying to use that creates an error......

If UCase(Range("D26").Value) = UCase("YES") _
Then
Sheets("BOY").EntireColumn("H").Hidden = False
ElseIf UCase(Range("D26").Value) = UCase("NO") _
Then
Sheets("BOY").EntireColumn("H").Hidden = True
End If