Copy/pasting visible rows using macro?

[Closed]
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
I am trying to use the 'record new macro' which is all I have experience with. My objective is to filter out rows by a date on my spreadsheet and copy those visible rows into another tab (tab 2) on the same workbook. I want to be able to filter different dates and do this several times and have a running list on tab 2. So when I copy my next set of rows, they will paste above or below what is already there on tab 2. Can you help?

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Depends where you are pasting. If you intentionally pasting over it, of course it will be wiped out. Since you want to do it in a running manner, before you paste next time, you need to know where you ended last time

lmaxrows =sheets("my running total").cells(rows.count, "A").end(xlup).row

will give you last used row in column A

Also when you copy, copy from 2nd row and down, else you would be pasting header every time too.