Conditional Formatting command translated into VB

  • Thread starter Thread starter jaggy
  • Start date Start date
J

jaggy

I have a worksheet were I need to color a row based on two criteria -
(1) if the value in cell E6 is "No" and cell C6 is blank, I would like
to color the entire row green. I need to do this for an entire
worksheet and I would like to do this in VB. Is this possible?

Any help would be greatly appreciated,
Jaggy
 
Try this ...

===============================================
Sub Naveen2()
For Counter = 1 To ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
If Cells(Counter, 3) = "No" And Cells(Counter, 5) = "" Then
With Rows(Counter).Interior
.ColorIndex = 50
.Pattern = xlSolid
End With
End If
Next Counter
End Sub
===============================================

*** Please do rate ***
 

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

Back
Top