ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Filters and dynamic ranges (https://www.excelbanter.com/excel-programming/338612-filters-dynamic-ranges.html)

RD Wirr

Filters and dynamic ranges
 
I have recorded a VBA routine that uses the Advanced filter (activated from
the menu) to filter a dynamic range with 5 columns and around 300 rows of
data. It then copies the filtered data and pastes it into a another location.
The problem is, if the filter comes up empty, instead of pasting one row of
nothing, the cut and paste part of the procedure pastes 300 rows of "#ref"
into the location. In this case writing over my database... Anyone have an
idea about how to avoid this happening if the filtered data is an empty set?
Thanks in advance,
RD Wirr

Tom Ogilvy

Filters and dynamic ranges
 
If your using the advanced filter, then use the copy to another location
option.

then you can delete the visible rows if anything is in the new location.

--
Regards,
Tom Ogilvy

"RD Wirr" wrote in message
...
I have recorded a VBA routine that uses the Advanced filter (activated

from
the menu) to filter a dynamic range with 5 columns and around 300 rows of
data. It then copies the filtered data and pastes it into a another

location.
The problem is, if the filter comes up empty, instead of pasting one row

of
nothing, the cut and paste part of the procedure pastes 300 rows of "#ref"
into the location. In this case writing over my database... Anyone have an
idea about how to avoid this happening if the filtered data is an empty

set?
Thanks in advance,
RD Wirr





All times are GMT +1. The time now is 10:59 PM.

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