R
rbekka33
Hi
this almost works - my only problem is that i don't know how to selec
the very last row and paste the data - any ideas?
Sub CopyPaste()
Range("h5").Activate
Set ac = ActiveCell
ac.Copy
Do
Windows("source.xls").Activate
Sheets("Data").Activate
Range("a1").Activate
Range("a2").Columns("A:A").EntireColumn.Select
Selection.Find(what:=ac).Select
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
Windows("Database.xls").Activate
Sheets("Data").Select
' the next lines need to be dynamic - to find the last row in column a
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Offset(7562, 0).Range("A1").Select
'this won't paste because the areas are different - not sure how to fi
this
ActiveCell.EntireRow.Paste
Sheets("Sheet1").Select
ActiveCell.Offset(1, 0).Select
Loop Until ActiveCell.Offset(-1, 0) = ""
End Sub
thank
this almost works - my only problem is that i don't know how to selec
the very last row and paste the data - any ideas?
Sub CopyPaste()
Range("h5").Activate
Set ac = ActiveCell
ac.Copy
Do
Windows("source.xls").Activate
Sheets("Data").Activate
Range("a1").Activate
Range("a2").Columns("A:A").EntireColumn.Select
Selection.Find(what:=ac).Select
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
Windows("Database.xls").Activate
Sheets("Data").Select
' the next lines need to be dynamic - to find the last row in column a
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Offset(7562, 0).Range("A1").Select
'this won't paste because the areas are different - not sure how to fi
this
ActiveCell.EntireRow.Paste
Sheets("Sheet1").Select
ActiveCell.Offset(1, 0).Select
Loop Until ActiveCell.Offset(-1, 0) = ""
End Sub
thank