cut & copy line...

S

sal21

i have a wbook with 2 sheets.
sheet1 and sheet2.
in every sheets are many data.
the range of column A3 : P30000 is the same range for every sheets.

my problem is:

Make a vlookup in sheet1 A3:A30000 from sheet2 A3:A30000, if the value
is finded in this range cut the relative line, and copy the entire line
in the shett3 start the copy of lines from A3, rearrange the sheet...
with no blank line
 
R

rick_deacha

try this sal21



Code:
--------------------

Dim i, count as long

Sub YourMacro()
count=3
For i=3 to 3000
If Sheets("sheet1").cells(i,1).value=Sheets("sheet2").cells(i,1).value then
Sheets("sheet1").Select
Rows(i & ":" & i).select
Selection.Copy
Sheets("Sheet3").Select
Rows(count & ":" & count).Select
ActiveSheet.Paste
count=count+1
End if
Next
End Sub
 
Top