View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
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.