Hello,
I have the following code but I am trying to modify it a bit...
Sub copycolumns()
Dim lastrow As Long, erow As Long
lastrow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To lastrow
Sheet1.Cells(i, 1).Copy
erow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Sheet1.Paste Destination:=Worksheets(“Sheet2”).Cells(erow, 1)
Sheet1.Cells(i, 3).Copy
Sheet1.Paste Destination:=Worksheets(“Sheet2”).Cells(erow, 2)
Sheet1.Cells(i, 6).Copy
Sheet1.Paste Destination:=Worksheets(“Sheet2”).Cells(erow, 3)
Next i
Application.CutCopyMode = False
Sheet2.Columns().AutoFit
Range(“A1”).Select
End Sub
I wanted to ask – is there a way to have the data paste to a different area? In other words, the two tabs would not be identical. The headings will be (in row 1 of both sheets), but there will be other data in the paste tab. Column A of both tabs will have letters, either TE, KE, or CYTB…The tab with the data to copy will be all TE, the paste tab will have all three codes….but they will be in order (for example - rows 1-100 will be CYTB, 101-200 TE, 201-300 KE). Is there a way to say copy this data and paste to the 7th column when you see the first TE in column A?
Additionally, is there a way to sync it up so if I add rows in the first sheet, it will add in the proper area of the second sheet (the proper place in the TE section of sheet 2)?
Please do let me know if you can help or what I can do to help and if you need any additional information/clarification.
Any assistance is greatly appreciated!
I have the following code but I am trying to modify it a bit...
Sub copycolumns()
Dim lastrow As Long, erow As Long
lastrow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To lastrow
Sheet1.Cells(i, 1).Copy
erow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Sheet1.Paste Destination:=Worksheets(“Sheet2”).Cells(erow, 1)
Sheet1.Cells(i, 3).Copy
Sheet1.Paste Destination:=Worksheets(“Sheet2”).Cells(erow, 2)
Sheet1.Cells(i, 6).Copy
Sheet1.Paste Destination:=Worksheets(“Sheet2”).Cells(erow, 3)
Next i
Application.CutCopyMode = False
Sheet2.Columns().AutoFit
Range(“A1”).Select
End Sub
I wanted to ask – is there a way to have the data paste to a different area? In other words, the two tabs would not be identical. The headings will be (in row 1 of both sheets), but there will be other data in the paste tab. Column A of both tabs will have letters, either TE, KE, or CYTB…The tab with the data to copy will be all TE, the paste tab will have all three codes….but they will be in order (for example - rows 1-100 will be CYTB, 101-200 TE, 201-300 KE). Is there a way to say copy this data and paste to the 7th column when you see the first TE in column A?
Additionally, is there a way to sync it up so if I add rows in the first sheet, it will add in the proper area of the second sheet (the proper place in the TE section of sheet 2)?
Please do let me know if you can help or what I can do to help and if you need any additional information/clarification.
Any assistance is greatly appreciated!