View Single Post
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Hashyar,

Copy the code below, right-click the sheet tab of interest, select "View
Code" and paste in the window that appears.

HTH,
Bernie
MS Excel MVP


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

If Target.Column = 1 And Target.Value = "AB" Then
Columns("C:E").EntireColumn.Hidden = False
End If

If Not Intersect(Target, Range("C:E")) Is Nothing Then
Columns("C:E").EntireColumn.Hidden = True
End If

End Sub


"Hoshyar" wrote in message
...
I have a workbook of 10 columns. three columns 3,4 and five are hidden by
default. I want to unhide these columuns when I write a defined letter
(e.g.
AB) in any cell in column one. Then I want to fill some information these
columns, then after pressing enter I want these columns to be hidden
again.
is that possible with macro?

many thanks in advance
Hoshyar