Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to hide column based on value on another sheet
Try this:
If UCase(Range("D26").Value) = UCase("YES") _ Then Sheets("BOY").Range("H:H").EntireColumn.Hidden = False ElseIf UCase(Range("D26").Value) = UCase("NO") _ Then Sheets("BOY").Range("H:H").EntireColumn.Hidden = True End If Michael Arch. Please rate this posting if helpful "CH" wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to hide column based on value on another sheet
Works Perfect Thanks!
On Aug 3, 10:40 am, Michael wrote: Try this: If UCase(Range("D26").Value) = UCase("YES") _ Then Sheets("BOY").Range("H:H").EntireColumn.Hidden = False ElseIf UCase(Range("D26").Value) = UCase("NO") _ Then Sheets("BOY").Range("H:H").EntireColumn.Hidden = True End If Michael Arch. Please rate this posting if helpful "CH" wrote: 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- Hide quoted text - - Show quoted text - |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to hide column based on value on another sheet
Please rate the posting.
"CH" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Hide rows based on value of column F | Excel Discussion (Misc queries) | |||
Macro to hide column based on header name | Excel Programming | |||
Hide/unhide sheet macro based on cell calculation | Excel Programming | |||
MACRO - copy rows based on value in column to another sheet | Excel Programming | |||
macro to hide column based on header | Excel Programming |