View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
The Grape Hunter The Grape Hunter is offline
external usenet poster
 
Posts: 2
Default Loop syntax help

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