OfficeUser
Well-known Member
- Joined
- Feb 4, 2010
- Messages
- 544
- Office Version
- 365
- 2016
- Platform
- Windows
I need to copy data from one sheet to another. I use this code to find the first empty row.
Cell B2 on "Main" will always hold a value so it will always be copied to the first empty cell in column A on sheet "Track". I also would like to copy all the values held in B3:B10, B12 to the same row on the sheet "Track".
I could write a similar macro for each cell I need to copy but not every cell on "Main" will always have a value, so my data would end up getting jumbled. How do I say that when it finds the first empty row, for example if its row 46, so that "Track"A46 = "Main"B2, "Track"B46 = "Main"B3 , "Track"C46 = "Main"B4, and so on?
Thanks.
Code:
Sub MoveTrackingData()
Worksheets("Main").Range("B2").Copy
Worksheets("Track").Select
Range("A1000").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
End Sub
Cell B2 on "Main" will always hold a value so it will always be copied to the first empty cell in column A on sheet "Track". I also would like to copy all the values held in B3:B10, B12 to the same row on the sheet "Track".
I could write a similar macro for each cell I need to copy but not every cell on "Main" will always have a value, so my data would end up getting jumbled. How do I say that when it finds the first empty row, for example if its row 46, so that "Track"A46 = "Main"B2, "Track"B46 = "Main"B3 , "Track"C46 = "Main"B4, and so on?
Thanks.