Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How Unhide & Hide Columns with VBA | Excel Discussion (Misc queries) | |||
Conditional Format - Hide/Unhide | Excel Worksheet Functions | |||
Hide/Unhide columns using button on top over relevant columns | Excel Discussion (Misc queries) | |||
Unhide and hide columns | Excel Worksheet Functions | |||
hide / unhide columns | Excel Programming |