I have these 2 statements:
The first one is to look in row 4 and any cells that have "a" in them then hide that column.
The second is to look in row 5 and any cells that have "R" in them, then hide those columns.
How can I make it so that it is looking at both row 4 for "a" 's, and row 5 for "R" 's and hides all of those columns that meet that criteria?
Code:
For Each Cell In Range(Cells(4, 6), Cells(4, lCol))
If Cell = "a" Then Columns(Cell.Column).Hidden = True Else Columns(Cell.Column).Hidden = False
Next
Code:
For Each Cell In Range(Cells(5, 6), Cells(5, lCol))
If Cell = "R" Then Columns(Cell.Column).Hidden = True Else Columns(Cell.Column).Hidden = False
Next
The first one is to look in row 4 and any cells that have "a" in them then hide that column.
The second is to look in row 5 and any cells that have "R" in them, then hide those columns.
How can I make it so that it is looking at both row 4 for "a" 's, and row 5 for "R" 's and hides all of those columns that meet that criteria?