PDA

View Full Version : Excel VBA - Hide cell values based on ComboBox selection



jpergega
03-23-2015, 03:07 AM
Hi

I have created a comboBox and I want to hide certain values in the cells based on what is selected in the list, so only the matching text will show.

Here is my code but I am not sure how to go from here Please Help!:



Private Sub Worksheet_Change(ByVal Target As Range)
With Sheet1.ComboBox1
.AddItem "Programme A"
.AddItem "Programme B"
.AddItem "Programme C"

End With

If Not Intersect(Target, Range("A10:AG82")) Is Nothing Then
If Range("A10:AG82") = "Programme A" Then
Cell.Hidden = True
Else
Cell.Hidden = False
End If
End If
End Sub