I'm working on a template part of which requires me to copy and paste multiple rows of values with the same number of columns from different sheets and append them together (i.e. copy values in sheet 1, paste in sheet 10, copy value from sheet 2, paste in sheet 10 but after the last row of the values copied from sheet 1, and so on). I usually use
Range(Selection, Selection.End(xlDown)).Select
Range(Selection,Selection.End(xlToRight)).Select
to copy the data.
Then I use a do while statement to find the last row of the target sheet (i.e. sheet 10) and paste it there:
Range("A6").Select Do While ActiveCell.Value <> "" ActiveCell.Offset(1, 0).Select Loop Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False
But I'm having a problem if one of the source sheets only has one row. It copies the row and all the empty rows after it till the bottom row of excel, and thus, excel is unable to paste it to the target sheet because of its size. Any better way to do this?