Hello all,
I would like a macro that does this...
Note for below that the "state" column will never be in a fixed column position, so this macro must search for "state" by name and not column position.
1. Find the column named "state"
2. Bring up a message box saying "Please enter the state/states you would like to use, separate each state with a comma"
3. The user would then enter in each state/states they want to use and press "OK"
4. The macro then deletes ALL ENTIRE ROWS NOT matching the state/states IN THAT COLUMN that were entered in the message box by the user (except the header row of course).
To clarify number 4 further, the macro should ONLY look in the "state" column when deciding whether to delete the WHOLE ROW or not.
5. The case should be non case-sensitive, for the "active worksheet", and if possible, should work whether the user enters in more states with either
a) comma state
or
b) comma space state
6. Also, I'm only using "states" for example reasons only but actual text length can more more characters long. The criteria entered in the message box should not be limited to two characters.
thanks much!
Last edited by duugg; 07-23-2009 at 11:24 AM. Reason: searchability
Try the attachment, you can see the code by hitting Alt F11.
Martin
Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.
If my solution has saved you time and/or money, please consider donating to Cancer Research UK.
mrice,
worked awesome!
thanks much!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks