Eloise T
Active Member
The attached Workbook contains 3 tabs. Data is added each week to the tabs. The VBA macro "YellowHighlightColumnsAThroughH" when run will highlight the newly added rows of data. However, I do not want the macro to yellow highlight a row where Column H contains, "NO INV" or any extension thereof, e.g. NO IN, NO INV, NO INVOICE, NO INVOICE THIS WEEK, etc.
The CODE below works without the line:
If ws.Range("A3:H") <> "NO IN" Then (with its accompanying End If of course)
but it colors all rows with data including those containing "NO IN"
Please see the attachment and the tab labeled "Paul."
I need help modifying that line: If ws.Range("A3:H") <> "NO IN" Then
so it will not yellow highlight any line A - H containing "NO IN" etc.
Thank you for your assistance in advance.
The CODE below works without the line:
If ws.Range("A3:H") <> "NO IN" Then (with its accompanying End If of course)
but it colors all rows with data including those containing "NO IN"
Please see the attachment and the tab labeled "Paul."
I need help modifying that line: If ws.Range("A3:H") <> "NO IN" Then
so it will not yellow highlight any line A - H containing "NO IN" etc.
Thank you for your assistance in advance.
Code:
Sub YellowHighlightColumnsAThroughH()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Formula Info" And ws.Name <> "Dave" Then
If ws.Cells(Rows.Count, "A").End(xlUp).Row > 2 Then 'Changed 3 to "A" which is the same.
If ws.Range("A3:H") <> "NO IN" Then
ws.Range("A3:H" & ws.Cells(Rows.Count, 3).End(xlUp).Row).Interior.Color = vbYellow '= RGB(255, 255, 0)
End If
End If
End If
Next
End Sub
Last edited: