ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Last Draw & Paste (https://www.excelbanter.com/excel-programming/300517-copy-last-draw-paste.html)

Michael168[_86_]

Copy Last Draw & Paste
 
I need a VBA which will always copy the last row of every sheet an
paste on the last row + 1 of the individual sheets.

I record the macro but that is not what I want and I don't know how t
modify the macro to make it works.

Can someone help?

Regards
Michae

--
Message posted from http://www.ExcelForum.com


Dave Peterson[_3_]

Copy Last Draw & Paste
 
Can you pick out a column that you can use to determine the lastused row?

I used column A for this code:

Option Explicit
Sub testme()
Dim LastRow As Long
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
With wks
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Rows(LastRow).Copy _
Destination:=.Rows(LastRow + 1)
End With
Next wks

End Sub


"Michael168 <" wrote:

I need a VBA which will always copy the last row of every sheet and
paste on the last row + 1 of the individual sheets.

I record the macro but that is not what I want and I don't know how to
modify the macro to make it works.

Can someone help?

Regards
Michael

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson



All times are GMT +1. The time now is 02:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com