I have a app running 2 workbooks which both generate data on sheet 2. Is there a way i can merge both of the sheet 2's onto a different sheet in one of the open workbooks. I would like to do this with a macro if poss. The data on the sheets will change each time i want to merge them.
You need to describe exactly what you want to do (what do you mean by merge?)
I want to just put the data from both sheets onto one sheet automatically when i press a button
Added together? Side by side? One under the other?
Do you have headings/totals/formulas on the sheets?
Added together? Side by side? One under the other?
Do you have headings?
Headings as follows
Date Code Product Qty Size
I want the destination sheet to show the other 2 sheets as 1, 1 under the other as if the data from the 2 sheets was just generated on the 1
Do u understand or do u req more info
Try this :-
Sub Copy_Paste()
Dim source1 As Worksheet
Dim source2 As Worksheet
Dim dest As Worksheet
Dim rng As Range, rws As Long
Set source1 = Worksheets("Sheet1")
Set source2 = Worksheets("Sheet2")
Set dest = Worksheets("Sheet3")
dest.Cells.ClearContents
source1.Cells.Copy
ActiveSheet.Paste dest.Range("A1")
source2.Range(source2.Cells(2, 1), source2.Cells(65536, 5).End(xlUp)).Copy
ActiveSheet.Paste dest.Cells(65536, 1).End(xlUp)
End Sub
Last line should read :-
ActiveSheet.Paste dest.Cells(65536, 1).End(xlUp).Offset(1,0)