This works completely no matter the number or rows in any give sheet.
In fact it doesn't even care about the number of columns either. Thi
part:
With Worksheets(n)
x = .UsedRange.Row - 1 + .UsedRange.Rows.Count
y = .UsedRange.Column - 1 + .UsedRange.Columns.Count
.Range(.Cells(1, 1), .Cells(x, y)).Copy
End With
selects the entire used range of each page and copies it.
"UsedRange.Row" finds the FIRST row with information (presumably thi
would be the first row, but you can never be too careful.) The
"UsedRange.Rows.Count" returns the number of rows used and adds the
together. Now after you've added the first row (say 1) and the numbe
of used rows (say ten) the result (11) is actually the number of th
row immediately after the last used row so we must subtract 1 from th
sum.
After that's done,
With Worksheets(1)
x = .UsedRange.Row + .UsedRange.Rows.Count
finds the first empty row in the totals sheet (notice the 1 is no
subtracted) and pastes in the information.
If this is copying more cells than you want it to, I'd say you probabl
have information in cells you don't know about. Maybe some spaces or i
a font that's the same color as the background. If that does not solv
your roblem, just post more specifics. - Piku