macro to highlight rows that meet specific conditions

A

amanda

Hello! Does anyone know how to write a macro that would highlight an
entire row if the cell value of A1 for example is 3 integers or
greater than the value in D1?

And, more specifically if I can also delete an entire row if the cell
value in a specified column is 1 or less AND the cell value in column
D is zero? Both of those conditione need to be true.

ThankS!
 
M

mvenkatesan45

Hello! Does anyone know how to write a macro that would highlight an
entire row if the cell value of A1 for example is 3 integers or
greater than the value in D1?

And, more specifically if I can also delete an entire row if the cell
value in a specified column is 1 or less AND the cell value in column
D is zero? Both of those conditione need to be true.

ThankS!

Hi
Try this code

N = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
For rwIndex1 = 1 To N
If Round(Cells(rwIndex1, 1).Value, 2) <> Round(Cells(rwIndex1,
9).Value, 4) Then
Cells(rwIndex1, 4).Interior.ColorIndex =
3
Next rwIndex1

its 2 column not match it will highlight red color on 4th column

Regards
Venky.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top