Combine two columns into one from two sheets
Closed
roy76
Posts
1
Registration date
Saturday 26 February 2011
Status
Member
Last seen
26 February 2011
-
26 Feb 2011 à 18:21
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 27 Feb 2011 à 17:33
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 27 Feb 2011 à 17:33
Related:
- Combine two columns into one from two sheets
- Combine notifications viber - Guide
- Google sheets download - Download - Spreadsheets
- Excel compare two sheets - Guide
- How to copy data from one excel sheet to another - Guide
- Google sheets right to left - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
27 Feb 2011 à 17:33
27 Feb 2011 à 17:33
In your code, the data is copied from sheet1 to sheet2. you modify the code to data to first copy from sheet 1 to sheet 3 and then sheet 2 to sheet 3
Dim lastrowA As Long
Dim lastrowB As Long
Set srcsht = Sheets("sheet1")
Set dstsht = Sheets("sheet3")
lastrowA = srcsht.Cells(Cells.Rows.Count, "A").End(xlUp).Row
lastrowB = dstsht.Cells(Cells.Rows.Count, "A").End(xlUp).Row + 1
srcsht.Range("a1:a" & lastrowA).EntireRow.copy dstsht.Cells(lastrowB, 1)
Set srcsht = Sheets("sheet2")
lastrowA = srcsht.Cells(Cells.Rows.Count, "A").End(xlUp).Row
lastrowB = dstsht.Cells(Cells.Rows.Count, "A").End(xlUp).Row + 1
srcsht.Range("a1:a" & lastrowA).EntireRow.copy dstsht.Cells(lastrowB, 1)
Dim lastrowA As Long
Dim lastrowB As Long
Set srcsht = Sheets("sheet1")
Set dstsht = Sheets("sheet3")
lastrowA = srcsht.Cells(Cells.Rows.Count, "A").End(xlUp).Row
lastrowB = dstsht.Cells(Cells.Rows.Count, "A").End(xlUp).Row + 1
srcsht.Range("a1:a" & lastrowA).EntireRow.copy dstsht.Cells(lastrowB, 1)
Set srcsht = Sheets("sheet2")
lastrowA = srcsht.Cells(Cells.Rows.Count, "A").End(xlUp).Row
lastrowB = dstsht.Cells(Cells.Rows.Count, "A").End(xlUp).Row + 1
srcsht.Range("a1:a" & lastrowA).EntireRow.copy dstsht.Cells(lastrowB, 1)