blossomthe2nd
Active Member
- Joined
- Oct 11, 2010
- Messages
- 450
Hi
I have a spread sheet has columns A-Z populated with headers.
I wish to write a code that will highlight certain columns based on a drop down in cell B1, see below.
*Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("B1").Value = "Red" Then
Columns("H:Z").EntireColumn.Hidden = True
Else
Columns("H:Z").EntireColumn.Hidden = False
End If
End Sub
*
This is working fine, but there are a few different combinations i need to use.
Is it possible to amend the above to state if range is equal to RED OR BLUE OR GREEN hide H:Z ?
And if so How ?
Thanks
I have a spread sheet has columns A-Z populated with headers.
I wish to write a code that will highlight certain columns based on a drop down in cell B1, see below.
*Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("B1").Value = "Red" Then
Columns("H:Z").EntireColumn.Hidden = True
Else
Columns("H:Z").EntireColumn.Hidden = False
End If
End Sub
*
This is working fine, but there are a few different combinations i need to use.
Is it possible to amend the above to state if range is equal to RED OR BLUE OR GREEN hide H:Z ?
And if so How ?
Thanks