I would like a macro that scrolls through each row and deletes it if it contains the word "Account" in column B.
Thanks for any help
I would like a macro that scrolls through each row and deletes it if it contains the word "Account" in column B.
Thanks for any help
Last edited by PhilSM; 02-02-2009 at 11:07 AM.
There a variety of ways to do this ... some will loop but I quite like to use the following method:
Please Login or Register to view this content.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Quite like this, is it possible to make the search and column variable ?
To be honest if you wanted it to be dynamic etc you would be best served reverting to the traditional loop & find method ... such that you can easily do partial matches etc...
A slightly more dynamic version of the prior method would be along the lines of:
But to reiterate - making the above more flexible is pretty worthless given standard Find method offers greater inherent flexibility for less effort ;-)Please Login or Register to view this content.
As I say for the odd check here & there I prefer the .SpecialCells method as I'm not a fan of looping... anything more complex... Find & Loop... you should find lots of examples here of the Find & Delete approach.
Last edited by DonkeyOte; 02-02-2009 at 08:55 AM. Reason: typo's...
try this if this is of any help
Below code will ask you what you want to delete and in which column u want to search
Eg. Input what u want to delete as "Account"
and for Column enter 1 , 2 , 3 etc.
Please Login or Register to view this content.
Shijesh Kumar
http://shijesh.wordpress.com/
Thanks very much, these both work a treat.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks