[RESOLVED] color change the entire rows
I am trying to do from outlook to excel if the cell value is empty change the entire row will be yellow but i have error Cells(c.Row, 7).Value = ""
Code:
With Sheets("Sheet1").Range("C6:C29")
Set c = .Find(MYName, LookIn:=xlValues)
If Not c Is Nothing Then
MyTime = olMail.ReceivedTime
Cells(c.Row, 7).Value = MyTime
Else
Cells(c.Row, 7).Value = ""
Range(Cells(c.Row, 1), Cells(c.Row, 7)).Interior.ColorIndex = 35
End If
End With
Re: color change the entire rows
Re: color change the entire rows
You will get an error if there is no text found because you will not get a value for c.Row in the "Else" part.
Re: color change the entire rows
could you help me Kool
so how do i put it in the code if the cell value is empty the entrie row will be changed the yellow color
Re: color change the entire rows
Quote:
Originally Posted by
kamakshi
could you help me Kool
so how do i put it in the code if the cell value is empty the entrie row will be changed the yellow color
Sure
Is this what you are trying?
Code:
With Sheets("Sheet1").Range("C6:C29")
Set c = .Find(MYName, LookIn:=xlValues)
If Not c Is Nothing Then
MyTime = olMail.ReceivedTime
Cells(c.Row, 7).Value = MyTime
Else
Range("C6:C29").Value = ""
Range("C6:C29").Interior.ColorIndex = 6 '<~~ Yellow Color
End If
End With
Re: [RESOLVED] color change the entire rows