Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default 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 :)




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping David T Excel Discussion (Misc queries) 2 August 30th 06 10:51 PM
looping Neal Excel Programming 2 May 19th 06 10:27 PM
looping to End Nabeel Moeen Excel Programming 2 February 25th 04 10:52 AM
Looping Andrew Clark[_2_] Excel Programming 1 December 20th 03 05:01 PM
Looping Syd[_4_] Excel Programming 1 December 11th 03 11:17 PM


All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"