Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping help please
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 :) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping help please
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) "Christy" wrote in message ... 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 :) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping help please
You the man Bob, it looks good to me.
"Bob Phillips" wrote: 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) "Christy" wrote in message ... 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 :) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping help please
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? "Bob Phillips" wrote: 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) "Christy" wrote in message ... 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 :) |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping help please
SORRY! I just had a typo - that worked great
Thank you!!!!!! Christy :) "Christy" wrote: 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? "Bob Phillips" wrote: 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) "Christy" wrote in message ... 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 :) |