I brought this up on another forum but I think I should have brought it here instead.
I'm having some trouble with this bit of code and can't seem to figure why it doesn't execute properly.
I need the code to check the cells in the B:B Range and if the cell's font.colorindex = 1 then hide the row, otherwise leave the row as is.
here's the code I currently have
Code:
It seems pretty straight forward. Any Ideas?
Also, can the same principle be applied to columns? And how does the lastRow variable transpose to counting columns?
lastRow = Cells(Rows.Count, "D").End(xlUp).Row
lastColumn = [this is stumping me]
darn my inferior VBA skills.
Anyone willing to offer some help on this?
I'm having some trouble with this bit of code and can't seem to figure why it doesn't execute properly.
I need the code to check the cells in the B:B Range and if the cell's font.colorindex = 1 then hide the row, otherwise leave the row as is.
here's the code I currently have
Code:
Code:
For Each Cell In Range("B2:B" & lastRow)
If Cell.Font.ColorIndex = 1
Then Rows.Select.EntireRow.Hidden = True
Else: Rows.EntireRow.Hidden = False
End If
Next Cell
It seems pretty straight forward. Any Ideas?
Also, can the same principle be applied to columns? And how does the lastRow variable transpose to counting columns?
lastRow = Cells(Rows.Count, "D").End(xlUp).Row
lastColumn = [this is stumping me]
darn my inferior VBA skills.
Anyone willing to offer some help on this?