Hi!
Sorry for the vague subject. I have a seemingly simple task at hand, however lacking ideas towards solution. Can't even figure out great keywords for search.
I need to copy some data from Sheet2 to Sheet1 via VBA. There are 10 columns of data on Sheet2 (range A:J - can copy them all). However, the actual row count is unknown (varies). Still, I know data is consistent, so first empty row in Sheet2 column A means the end of area to be copied.
How can I copy an area where the row count is yet to be identified (although column count is known)?
Ideally I'd like to copy starting from Sheet2 cell A2 and paste to Sheet1 cell A2, as both sheets have headers, but overwriting them is not a big deal. Still, Copy-Paste just values should be more important, but I don't expect trouble handling this.
I would prefer NOT to hardcode the range which would likely cover all the filled area to the like of:
Thanks a bunch!
Sorry for the vague subject. I have a seemingly simple task at hand, however lacking ideas towards solution. Can't even figure out great keywords for search.
I need to copy some data from Sheet2 to Sheet1 via VBA. There are 10 columns of data on Sheet2 (range A:J - can copy them all). However, the actual row count is unknown (varies). Still, I know data is consistent, so first empty row in Sheet2 column A means the end of area to be copied.
How can I copy an area where the row count is yet to be identified (although column count is known)?
Ideally I'd like to copy starting from Sheet2 cell A2 and paste to Sheet1 cell A2, as both sheets have headers, but overwriting them is not a big deal. Still, Copy-Paste just values should be more important, but I don't expect trouble handling this.
I would prefer NOT to hardcode the range which would likely cover all the filled area to the like of:
Code:
Worksheets("Sheet2").Range("A2:J5000").Copy
Thanks a bunch!
Last edited: