Copy and Paste LAST ROW of data: non-contiguous Row, contiguous Column
The following routine will copy the last row on ALL worksheets in the
active workbook, so you can put this macro in any workbook you want and use
it across multiple workbooks. It copies the entire cell contents, formulas,
formats, comments and all.
Public Sub CopyLastRowAllSheets()
Dim ws As Worksheet
Dim rngLastRow As Range
For Each ws In ActiveWorkbook.Worksheets
With ws.UsedRange
Set rngLastRow = .Resize(1).Offset(.Rows.Count - 1)
End With
With rngLastRow
.Copy Destination:=.Offset(1)
End With
Next ws
End Sub
--
Regards,
Bill Renaud
|