Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default 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   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

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Hide rows based on value of column F Scott Marcus Excel Discussion (Misc queries) 10 October 27th 06 11:57 PM
Macro to hide column based on header name [email protected][_2_] Excel Programming 6 October 11th 06 10:09 PM
Hide/unhide sheet macro based on cell calculation Greg Fisher Excel Programming 3 May 26th 05 05:58 PM
MACRO - copy rows based on value in column to another sheet Mike Excel Programming 2 March 5th 05 12:21 AM
macro to hide column based on header Todd[_6_] Excel Programming 6 September 4th 03 04:34 AM


All times are GMT +1. The time now is 11:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"