Hide column based on data validation

Joined
Nov 27, 2012
Messages
1
Reaction score
0
Hi Excel pros,

How could I hide a column based on a data validation list?
I applied the instructions in a 2004 post of this forum titled 'Hide Columns based on a Data Validation List', but couldn't figure it out.

I'd like to display column H if "Scolaire" or "Service Spécial" is selected at least once in the data validation list of the column N.

Private Sub Worksheet_Change(ByVal Target As Range)

Select Case Target.Value
Case "Ligne"
Columns("I:J").Hidden = True
Case "Scolaire"
Columns("I:J").Hidden = False
Case "Service Spécial"
ActiveSheet.Columns("I:J").EntireColumn.Hidden = False
Case "Occasionnel"
ActiveSheet.Columns("I:J").EntireColumn.Hidden = True
End Select

End Sub

Thanks for your help.
Shahbaz
 
Last edited:
Back
Top