ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy & Paste (https://www.excelbanter.com/excel-programming/421745-copy-paste.html)

bijan

copy & Paste
 
Hi all
I am looking for a vba solution for copy&paste or something else to join 3
sheets to one sheet like this sample:
sheet1: sheet2:
sheet3:
___date_______amount1 ___date_______amount2 __date_______amount3
1 2006/01/01 11111.00 1 2001/01/01 44444.00 1 2002/01/01 77777.00
2 2002/01/01 22222.00 2 2003/01/01 55555.00 2 2004/01/01 88888.00
3 2005/01/01 44444.00 3 2005/01/01 55555.00 3 2001/01/01 77777.00

Target sheet
___date_______amount1_____amount2_______amount3
1 2006/01/01 11111.00
2 2002/01/01 22222.00
3 2005/01/01 44444.00
4 2001/01/01 44444.00
5 2003/01/01 55555.00
6 2005/01/01 55555.00
7 2002/01/01 77777.00
8 2004/01/01 88888.00
9 2001/01/01 77777.00
Thanks in advance
Bijan


Don Guillett

copy & Paste
 
Try this. Change sheet4 to your master sheet name

Sub consolicatesheets()
For i = 1 To Sheets.Count
MsgBox Sheets(i).Name
If Sheets(i).Name < "Sheet4" Then
With Sheets("sheet4")
dlr = .Cells(Rows.Count, 1).End(xlUp).Row + 1
slr = Sheets(i).Cells(Rows.Count, 1).End(xlUp).Row
Sheets(i).Cells(2, 1).Resize(slr, 3).Copy .Cells(dlr, 1)
End With
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"bijan" wrote in message
...
Hi all
I am looking for a vba solution for copy&paste or something else to join 3
sheets to one sheet like this sample:
sheet1: sheet2:
sheet3:
___date_______amount1 ___date_______amount2 __date_______amount3
1 2006/01/01 11111.00 1 2001/01/01 44444.00 1 2002/01/01
77777.00
2 2002/01/01 22222.00 2 2003/01/01 55555.00 2 2004/01/01
88888.00
3 2005/01/01 44444.00 3 2005/01/01 55555.00 3 2001/01/01
77777.00

Target sheet
___date_______amount1_____amount2_______amount3
1 2006/01/01 11111.00
2 2002/01/01 22222.00
3 2005/01/01 44444.00
4 2001/01/01 44444.00
5 2003/01/01 55555.00
6 2005/01/01 55555.00
7 2002/01/01 77777.00
8 2004/01/01 88888.00
9 2001/01/01 77777.00
Thanks in advance
Bijan




All times are GMT +1. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com