Guzzlr
Well-known Member
- Joined
- Apr 20, 2009
- Messages
- 984
- Office Version
- 2021
- Platform
- Windows
Hello, I have:
Instead of keying on row 23 for my loop, I am trying to have a range of cells from row 23 to row 28 with the color index of 44
Same for the second IF only for color index of 46
How can I do this? If I only have one row, say row 23...the code works fine.
Thank you
VBA Code:
Sub ShowIce()
Dim i As Integer
Sheets("EAP L1 - Current Mainline").Activate
For i = 6 To 600
If Cells(Range("23:28"), i).Interior.ColorIndex = 44 Then
Columns(i).EntireColumn.Hidden = False
End If
If Cells("23:28", i).Interior.ColorIndex = 46 Then
Columns(i).EntireColumn.Hidden = True
End If
Next i
Instead of keying on row 23 for my loop, I am trying to have a range of cells from row 23 to row 28 with the color index of 44
Same for the second IF only for color index of 46
How can I do this? If I only have one row, say row 23...the code works fine.
Thank you