VBA Highlighting under multiple conditions

ntextreme3

New Member
Joined
Jul 17, 2013
Messages
3
Hey, I have a sheet here that auto-populates with a list of warnings/errors. they start at row 3 and keep going until the list is finished. I'm trying to find a way to highlight only errors if there is no false positive message offset 2 columns from that error. This works fine for highlighting errors. I tried running the same code concurrent in column e checking for blanks and set color to 0 but as expected it overwrites the row highlighting already in place, and i cant have that.

Code:
Sub highlight()
   Dim cell As Range


   Range(Range("c3"), Range("c3").End(xlDown)).Select
   For Each cell In Selection
      If cell = "ERROR" Then cell.EntireRow.Interior.ColorIndex = 3
   Next cell


   End Sub

what i need is something like


Code:
Sub highlight()
   Dim cell As Range


   Range(Range("c3"), Range("c3").End(xlDown)).Select
   For Each cell In Selection
      If cell = "ERROR" [U][B]And cell.Offset(0, 2) <> "" [/B][/U]Then cell.EntireRow.Interior.ColorIndex = 3
   Next cell


   End Sub


help! thanks in advance
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top