Hi,
I think this is a fairly straight forward problem but I can't figure it out. I am using VBA to copy data, cell-by-cell from one sheet to another. One of the sheets continuously updates while the other sheet records all of the data. I have been figuring out how to find the last cell so that vba will automatically find where it has to put the data.
This is my code for finding the last cell:
LastRow = Sheets("Data by Rows").Range("A65536").End(xlUp).Row
Cells(LastRow, 1).Select
LastColumn = ActiveCell.End(xlToRight).Column
LastCell = Cells(LastRow, LastColumn).Address
This is a bit roundabout, but each set of data is copied on a different row, but as I said its coping cell-by-cell, across the columns in a row, so this is the easiest way I figured to do it.
My problem is that I can't figure out how to continuously update LastCell after it copies each cell. This is an example of the copying code:
Cells(LastRow + 1, 2) = Application.VLookup("X Velocity", Range("VelocityParameters"), 2, False)
Range(LastCell).Offset(0, 1) = Application.VLookup("Y Velocity", Range("VelocityParameters"), 2, False)
Range(LastCell).Offset(0, 1) = Application.VLookup("Angle", Range("VelocityParameters"), 2, False)
NB. the first line finds the new row in which to place the new data set
Ideally, I'd like LastCell to automatically update so I don't have to kept telling it where the data needs to go.
Any advice would be much appreciated.
Thanks in advance.