Combine two columns into one from two sheets
Closed
roy76
Posts
1
Registration date
Saturday February 26, 2011
Status
Member
Last seen
February 26, 2011
-
Feb 26, 2011 at 06:21 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Feb 27, 2011 at 05:33 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Feb 27, 2011 at 05:33 PM
Related:
- Combine two columns into one from two sheets
- Display two columns in data validation list but return only one - Guide
- Combine notifications viber - Guide
- Sheets right to left - Guide
- Excel compare two sheets - Guide
- Excel copy data from one sheet to another - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Feb 27, 2011 at 05:33 PM
Feb 27, 2011 at 05:33 PM
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)