Any trics to make code below faster/easier/shorter?
I'm also out of OR statements and need to add more, I don't know how.
Thanks in advice for any help with this one.
![]()
Please Login or Register to view this content.
Any trics to make code below faster/easier/shorter?
I'm also out of OR statements and need to add more, I don't know how.
Thanks in advice for any help with this one.
![]()
Please Login or Register to view this content.
Last edited by louvaek; 06-13-2019 at 07:42 AM.
Administrative Note:
Welcome to the forum.
We would very much like to help you with your query, however you need to include code tags around your code.
Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.
Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
(Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
Like this?
Hi louvaek,
One way to get around the issue with all the or statements (and not having room for more) would be to add the items to a dictionary, and then just using that for a simple check. It may also speed things up slightly since the comparison gets simplified, but I doubt it will make a huge performance difference. I changed your loop because it said " For Lrow2 = Lastrow To Firstrow Step -1" but your variables have a 2 after them so this loop when tested was giving me Lrow2 values of 0
![]()
Please Login or Register to view this content.
Please help by:
Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know
There are 10 kinds of people in this world... those who understand binary, and those who don't.
Another variation is to use a list for values to be deleted
![]()
Please Login or Register to view this content.
Hello Louvaek,
Perhaps using Advanced Filter may be a better option:-
Using this method, you could place all the serial numbers to be deleted into Column A of a new sheet (named "List"), create a named range("Criteria") for all the numbers in Column A and then convert the list to a table. The table will expand/contract as you add/remove numbers.![]()
Please Login or Register to view this content.
I've attached a sample for you to test with but I've only added eight numbers to the "Criteria" list in this sample. Click on the "RUN" button to see it work.
I hope that this helps.
Cheerio,
vcoolio.
Another way with autofilter![]()
Please Login or Register to view this content.
Thank you guys, appreciate all these working solutions !!
*taking a bow*![]()
You're welcome & thanks for the feedback
You're welcome Louvaek. Glad that we were able to assist.
Thanks for the rep also.
Cheerio,
vcoolio.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks