Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Is there a conditional formula to hide and unhide columns?

Imagine you have a column A, where codes for certain categories are listed. I
would like Columns B and C, which are hidden, to be unhidden, when a certain
code is being entered in column A.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Is there a conditional formula to hide and unhide columns?

Hi,
Hope this will help.
Private Sub Worksheet_Change(ByVal Target As Range)
Col = ActiveCell.Column
Stop
If Col = 1 And ActiveCell.Value = "Certain Value" Then
ActiveCell.Columns("B:C").EntireColumn.Select
Selection.EntireColumn.Hidden = False
ActiveCell.Select
Else
End If
End Sub

"Frederic" wrote:

Imagine you have a column A, where codes for certain categories are listed. I
would like Columns B and C, which are hidden, to be unhidden, when a certain
code is being entered in column A.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Is there a conditional formula to hide and unhide columns?

A bit simpler, no selects

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.column = 1 And Target.Value = "Certain Value" Then
Columns("B:C")..Hidden = False
End If
End Sub

Also, this code should go into the appropriate sheet code module, not a
standard code module.


--
HTH

Bob Phillips

"David" wrote in message
...
Hi,
Hope this will help.
Private Sub Worksheet_Change(ByVal Target As Range)
Col = ActiveCell.Column
Stop
If Col = 1 And ActiveCell.Value = "Certain Value" Then
ActiveCell.Columns("B:C").EntireColumn.Select
Selection.EntireColumn.Hidden = False
ActiveCell.Select
Else
End If
End Sub

"Frederic" wrote:

Imagine you have a column A, where codes for certain categories are

listed. I
would like Columns B and C, which are hidden, to be unhidden, when a

certain
code is being entered in column A.



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
How Unhide & Hide Columns with VBA jean Excel Discussion (Misc queries) 1 June 17th 09 02:03 AM
Conditional Format - Hide/Unhide robzrob Excel Worksheet Functions 2 July 22nd 08 03:56 PM
Hide/Unhide columns using button on top over relevant columns [email protected] Excel Discussion (Misc queries) 1 March 7th 07 09:24 PM
Unhide and hide columns [email protected] Excel Worksheet Functions 1 October 23rd 06 07:16 PM
hide / unhide columns appeng Excel Programming 1 March 25th 05 10:16 PM


All times are GMT +1. The time now is 10:20 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"