Hi all,
I've looked at previous posts but still couldn't resolve the issue with a simple code, and would appreciate any navigations and advice - I'm beginner at this.
I work on a spreadsheet with only one worksheet, trying to come up with a decent way to highlight a row in a table ("Table1") that contains certain value (Conditional formatting is not something I want to use in this case).
When I debug, it highlights row 3 (count = ActiveSheet.Cells(Rows.count, "A").End(xIUp).Row)
Screenshots of a worksheet and code have been attached. There might be different ways of achieving this, anything would be of help!
Thank you for your time and help
I've looked at previous posts but still couldn't resolve the issue with a simple code, and would appreciate any navigations and advice - I'm beginner at this.
I work on a spreadsheet with only one worksheet, trying to come up with a decent way to highlight a row in a table ("Table1") that contains certain value (Conditional formatting is not something I want to use in this case).
VBA Code:
Sub Highlight()
Dim count, i As Long
count = ActiveSheet.Cells(Rows.count, "A").End(xIUp).Row
i = 17
Do While i <= count
If Cells(i, 2).Value = "Transport" Then
Range(Cells(i, 1), Cells(i, 12)).Interior.Color = RGB(67, 195, 233)
End If
i = i + 1
Loop
End Sub
When I debug, it highlights row 3 (count = ActiveSheet.Cells(Rows.count, "A").End(xIUp).Row)
Screenshots of a worksheet and code have been attached. There might be different ways of achieving this, anything would be of help!
Thank you for your time and help