Append Data to another sheet..

T

The Boondock Saint

Howdy all,

Ive got a sheet which will have 3 cols of data going down the sheet,
It will often have different numbers of rows of information, but id like to
append it to a master sheet,

is there a way that no matter how many rows are used (maybe like last row)
it would then copy it and put it on the end of all the data in the master
sheet,

for example...

if Sheet1 has 5 rows of data.... it would copy, a1:c5 and append it to any
data which is already in the master sheet,

of if it had say 3 rows of data, it would copy a1:c3 and tack it onto the
end of the master sheet..

Any advice would be awesome.

Cheers Saint...
 
D

Dave Miller

Try this:

David Miller

====================================================

Sub PasteCells()
Dim LastRow As String
LastRow = UBound(Sheets("Sheet1").UsedRange.Value)
Sheets("Sheet1").Range("A1:C" & LastRow).Copy
Sheets("Master").Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial
End Sub
 
T

The Boondock Saint

Awesome thanks dave, that works brillantly,

Just wondering, ive noticed in alot of code people put in numbers like 65536
, does that mean it will only go down to that number ... for example if
there was 70000 would it stop working at that number?

Just wondering, im trying to learn these little things.

Cheers Saint.
 
D

Dave Miller

Saint,

65536 is the number of rows in an excel sheet.

-for this use I am starting at the bottom of the sheet (65536) and
going up to find the last
used cell.

David Miller
 
Top