VBA: How to iterate through each cell of one specific row

  • Thread starter Thread starter Hank
  • Start date Start date
H

Hank

This seems like a simple task but I can't find anything in
the docs or Google.

How, using VBA, can I iterate through each used cell of a
specific row? For instance perform a test on each cell of
row 2?

I tried this, but it seems to select every cell of the
whole sheet:

For Each cell In ActiveSheet.UsedRange.Rows(2)


Thanks.
 
Hank,

Try

Dim Cell As Range
For Each Cell In ActiveSheet.UsedRange.Rows(2).Cells


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Back
Top