Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copying and Pasting Using Row Counts

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 !!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
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 !!!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Copying and Pasting Using Row Counts

I may be able to help you with this, but I need to know a few things about
your data. Where are lists A & B located? Are they both on sheet1? What
range do they occupy? Are there headers? Are the lists always going to be 50
& 100 rows long or can they vary in length? Does the "new worksheet" already
exist or do you want it added if it does not exist? If there are headers do
want them copied to the first row only of the "new worksheet"?
Mike F
"Stubbsy." wrote in message
...
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 !!!



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
average daily counts to weekly counts Dave Excel Discussion (Misc queries) 0 June 17th 08 06:24 PM
Copying and Pasting davew21 Excel Discussion (Misc queries) 1 March 31st 06 03:40 PM
Copying and pasting ??? NorcalTruck Excel Discussion (Misc queries) 3 December 27th 05 08:31 PM
Copying and Pasting Tia Excel Discussion (Misc queries) 4 June 6th 05 08:54 PM
Copying and Pasting teresa Excel Programming 2 May 29th 05 10:24 PM


All times are GMT +1. The time now is 11:04 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"