Can't iterate thru a row with For

P

peter

I'm trying to access the cells in a Row in the simplest manner, which I
assume is a For Each loop, but it doesn't work. Have I done something
wrong or is it VBA or Excel?
Thanks,
Peter.

Dim rRow3 As Range, rCell As Range
Set rRow3 = Rows(3)
rRow3.Interior.ColorIndex = iPink ' row 3 = pink
For Each rCell In rRow3
rCell.Interior.ColorIndex = iClear
' clears whole row!
If rCell.Value = "." Then ' type mismatch at runtime


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 

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