Looping help please

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Beginning with the following line of code

Sheet2.Range("b3").value = Sheet1.Range("b14").value

I need a loop that will step down 1 row on the left side and 15 rows on the
right side each time and that will repeat 42 times.

ie:
Sheet2.Range("b3").value = Sheet1.Range("b14").value
Sheet2.Range("b4").value = Sheet1.Range("b29").value

Any help would be greatly appreciated.

Christy :)
 
For i = 1 To 42
Sheet2.Range("B" & i + 2).Value = Sheet1.Range("B" & i * 15 -
1).Value
Next i


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
You the man Bob, it looks good to me.

Bob Phillips said:
For i = 1 To 42
Sheet2.Range("B" & i + 2).Value = Sheet1.Range("B" & i * 15 -
1).Value
Next i


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Thanks for your help Bob!

I tried this and got the following error

Method 'Range' of object '_Worksheet' failed

Can you tell me what I am doing wrong?
 

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

Back
Top