Evaluate cell in range and change cell attribute

S

S Himmelrich

I've been working on the following code, but get an error on the
designated line - can someone help?

Dim rCell As Range
Sheets("Form").Select
Range("B2:C450").Select
For Each rCell In Selection.Cells
If rCell.Interior.ColorIndex = 35 And rCell.Value = "" Then <---
ERROR OCCURS
rCell.Borders.Color = 3
End If
Next rCell
 
S

S Himmelrich

I get a type mismatch

if I put this line I still get an object error

If rCell.Interior.ColorIndex = 35 And rCell.Value Is Null Then

Not sure what is going on...humm...
 
M

Mike H

That's different than the code you posted yesterday when you were using ""

try this line

If rCell.Interior.ColorIndex = 35 And IsNull(rCell.Value) Then

Mike
 

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