M
Marcus =?iso-8859-15?Q?Sch=F6neborn?=
How to best move all rows that satisfy a given condition to another
file?
Like assume I have a boolean column, and I want to keep the TRUE ones in
my worksheet, but move the rows with a FALSE to another one.
Basically, it should look like a filter has been used, except that the
filtered out rows should not exist AT ALL (for example, sums shouldn't
include them). Instead, the rows that were filtered out should then
reside in a different XLS file as a backup.
My first idea was to make a DeleteRow(range) VBA function that does
range.EntireRow.Delete, and using that in a
=IF(condition;DeleteRow(1:1);0), but the Delete call seems to get
silently ignored when used from the very cell to be deleted. I know I
could make a VBA macro that iterates through all rows and does that,
but isn't there any simpler way?
But maybe the functionality already exists - and could somehow be done
with AutoFilters, like, making a copy of the worksheet that only
contains the VISIBLE cells?
file?
Like assume I have a boolean column, and I want to keep the TRUE ones in
my worksheet, but move the rows with a FALSE to another one.
Basically, it should look like a filter has been used, except that the
filtered out rows should not exist AT ALL (for example, sums shouldn't
include them). Instead, the rows that were filtered out should then
reside in a different XLS file as a backup.
My first idea was to make a DeleteRow(range) VBA function that does
range.EntireRow.Delete, and using that in a
=IF(condition;DeleteRow(1:1);0), but the Delete call seems to get
silently ignored when used from the very cell to be deleted. I know I
could make a VBA macro that iterates through all rows and does that,
but isn't there any simpler way?
But maybe the functionality already exists - and could somehow be done
with AutoFilters, like, making a copy of the worksheet that only
contains the VISIBLE cells?