Link to home
Start Free TrialLog in
Avatar of bengoa
bengoa

asked on

How to loop through range of cells in Excel VBA?

I am trying to use a For LOOP to alternate throught the range of cells in Excell but do not quite remember the syntex.   Here is what i am trying to do:  

On row 1 select first three cells (for example:  A1, B1, C1) and do something with it.  
Then next loop around should select next three cells on Row 1 (example:  D1, E1, F1)  and do somthing with it
Then next loop around should select next three cells on Row 1 (for example: G1, H1, I1) and do something with it.

I sort of started this but do not quite know how to alternate through Range("?1:?1")

For K = 1 To  30
    Range("?1:?3").Select
    Selection.Merge
    ActiveCell.FormulaR1C1 = "Question" & K
 Next K
 
In the place of questions mark not sure what to put...

Any help is appreciated.    
 
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bengoa
bengoa

ASKER

thank you.