You can try detecting whether a row is visible and just copy the ones that are.

Possibly useful links:

https://stackoverflow.com/questions/...d-visible-cell

https://techcommunity.microsoft.com/...ve/m-p/1798398