View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default Need VBA for Conditional Format of Row

for each c in range("h7:h700")
if ucase(c)="X" then rows(c.row).interior.colorindex=42
next c

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"DanielleVBANewbie" wrote in
message ...
Hi guys,

I need VBA code to add to an existing macro. If column H has an "x" in it
then I need that entire row highlighed as color 42 (light blue). Below is
what I tried but it isn't working. Any help would be appreciated.

Dim cfrange As range
Set cfrange = range("h7:h700")
If cfrange = "x" Then
range("A:G").Interior.ColorIndex = 42
End If

--
Danielle :<)