Hi!
Could anyone help with an advice concerning creating a VBA including 2 steps:
1)Filtering data by criteria "begins with";
2)Delete row if cell value = 0
See the file attached: Filtering-VBA.xls
Thanks in advance!
Hi!
Could anyone help with an advice concerning creating a VBA including 2 steps:
1)Filtering data by criteria "begins with";
2)Delete row if cell value = 0
See the file attached: Filtering-VBA.xls
Thanks in advance!
Last edited by Arty_1; 02-12-2015 at 02:24 AM.
Regards
Arty
Giver A Go
![]()
Please Login or Register to view this content.
Something's wrong - not filtring, deleting rows neither.
Must be,because I would give you a code that doesn't workSomething's wrong - not filtring, deleting rows neither
See attached.
Filtering-VBA.xls
Nothing... unfortunately.
I'm using XL 2003 at the moment. Could that be the reason of the issue?
I tried it on XL 2007,- it's not working.
Just move thedown.![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Thanks for the rep.
The code works for me. Slightly improved ...
![]()
Please Login or Register to view this content.
See the updated example.
Regards, TMS
In the file you're updated:
All the codes A; BB; CCC; DDDD; EEEE; FFFF etc. are shown as a result meanwhile
the constraint/criteria is to filter and show only the codes which begins with A; CCC; EEEE; GG; J; LLL
and then to delete the 0 values by the priciple:![]()
Please Login or Register to view this content.
delete row if b=c=0
That's what the code does, isn't it?. It filters for each element in the array and for each visible range, deletes rows where b=c=0 (in fact, b+c=0)
After filtering and deleting rows for each element, the filter mode is cleared so you see the all the remaining rows.
Regards, TMS
Nope. Some rows are deleted but still as a result it shows codes from A until M, furthermore values 0 are not deleted.
P.s. rows must be deleted by principle b=c=0 not b+c=0
OK, that's easy enough to fix. However, with your test data, it's not a problem. And the zero values remaining do not begin with the characters in your list/array.P.s. rows must be deleted by principle b=c=0 not b+c=0
I think a different approach will be required. Will look at it when I get a chance.
I've simplified the task, consequently only filtering the data by criteria "begins with" should be provided.
See the file attached: Filtering-VBA_simplified.xls
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks