Thread: Copy rows
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Martin[_26_] Martin[_26_] is offline
external usenet poster
 
Posts: 2
Default Copy rows

I'm trying to write a macro, that copy rows from sheet 2 to sheet 1
and the criteria for the rows in sheet 2 comes from sheet 3.
I'm very new to VBA, so I'm trying to piece different macros
together but can't get to do right.

Example:
Sheet 3 (performance sheet)
Stock no. 10 20 24 30
No. sold

Sheet 2 (inventory list)
Stock no. amount on stock. Amount sold
10 10 0
11 5 5
20 3 5
21 2 3
24 9 1
30 1 2
35 10 2

Result:
sheet 1
Stock no. amount on stock. Amount sold
10 5 5
20 3 5
24 9 1
30 1 2

I have a macro that kind of works, but it is very slow and if a number
doesn't exist in sheet 1, it stops with an error.
The numbers of criterias in sheet 3 varies so I need a loop, that runs
x numbers of time.

Could anyone help me please ?