Help with a complicated For ... Each ... Next statement.

A

Ayo

I want to use a For each cell in Range from E2 => BI2 to E7726 => BI7726 but
I only wabnt to do every other column. For instance:

For each c in Range("E2:E7726").Cells
Next c

For each c in Range("G2:G7726").Cells
Next c
..
..
..
For each c in Range("BI2:BI7726").Cells
Next c

My question is this, is there a way to write one For ... Each ... Next
statement that takes into account the every other column criteria? I don't
want to write 29 For ... Each ... Next statements.
 
P

Per Jessen

Hi

Look at this:

For cOff = 0 To 28*2 Step 2
For Each c In Range("E2:E7726").Offset(0, cOff).Cells

Next c
Next

Regards,
Per
 

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