View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ingolf Ingolf is offline
external usenet poster
 
Posts: 32
Default Copying and Pasting Using Row Counts

Hi, Stubbsy

list A in sheet 1, list B in sheet 2 and list C in sheet 3, with a
blank sheet 3 already existing:

Dim lng As Long
For lng = 1 To 50
With ThisWorkbook
.Sheets(1).Range(.Sheets(1).Cells(lng, 1), .Sheets(1).Cells(lng,
3)) _
.Copy Destination:=.Sheets(3).Range(.Sheets(3) _
.Cells(lng * 100 - 99, 1), .Sheets(3).Cells(lng * 100, 3))
.Sheets(2).Range(.Sheets(2).Cells(1, 1), .Sheets(2).Cells(100,
3)) _
.Copy Destination:=.Sheets(3).Range(.Sheets(3) _
.Cells(lng * 100 - 99, 4), .Sheets(3).Cells(lng * 100, 6))
End With
Next 'lng

Regards
Ingolf


Stubbsy. schrieb:

I have 2 lists A and B. List A has 50 items and List B has 100 items. Each
list has 3 columns of data.

I need to copy the first line of data from List A and paste into into a new
worksheet 100 times (the length of List B) and then copy List B and paste it
next to it to create a List C.

I then need to copy the second line of data from List A and paste it below
List C again 100 times (the lenght of List B) and again, copy List B and
paste it next to it (thus creatiing a List C that is now 200 rows).

And repeat this 50 times (the number of rows of data in List A).

I understand macros, and I know I can use a Loop using ROWS(), but can't get
it quite right. Please Help !!!