LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Loop syntax help

i = 1
Filler = Range("D17").Value
Do While i < Filler

Sheets("Sample Data").Select
Range("B" & (i + 2) & ":E" & (i + 2)).Select
Selection.Copy
Sheets("Sheet1").Select
Range("C" & (i + 20)).Select
ActiveSheet.Paste

i = i + 1
Loop

If this post helps click Yes
---------------
Jacob Skaria


"The Grape Hunter" wrote:

Access 2007 on Vista

The Excel macro recorder provided the three sample blocks of code (almost
identical you can see, but pattern flow should be noted) which I need to code
into a single block to repeat "n" times based on cell "D17". I know where I
am, I know where I want to get to, I just don't know the way to get there.
Many thanks in advance.


i = 1
Filler = Range("D17").Value

Do While i < Filler

Sheets("Sample Data").Select
Range("B3:E3").Select
Selection.Copy
Sheets("Sheet1").Select
Range("C21").Select
ActiveSheet.Paste

Sheets("Sample Data").Select
Range("B4:E4").Select
Selection.Copy
Sheets("Sheet1").Select
Range("C22").Select
ActiveSheet.Paste

Sheets("Sample Data").Select
Range("B5:E5").Select
Selection.Copy
Sheets("Sheet1").Select
Range("C23").Select
ActiveSheet.Paste

i = i + 1
Loop

The syntax to have this puppy perform is what I an needing.

Thanks ....TheGrapeHunter

 
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
Syntax for stopping a Do Loop? bondjel Excel Discussion (Misc queries) 5 March 22nd 10 01:35 PM
Need some syntax help, simple loop I think Mr B[_2_] Excel Programming 4 March 26th 08 01:11 PM
Do...Loop syntax help? DB74 Excel Programming 5 September 4th 07 07:04 PM
VBA Loop Case..If syntax okelly[_5_] Excel Programming 5 August 7th 06 03:24 PM
loop syntax Knox Excel Programming 2 May 17th 06 06:57 PM


All times are GMT +1. The time now is 05:00 AM.

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

About Us

"It's about Microsoft Excel"