what coding would I use to delete an entire row if the cell in the column met a certain conditional requirement? For example: I want to delete every row for which each cell in column A = Bob. Thanks
what coding would I use to delete an entire row if the cell in the column met a certain conditional requirement? For example: I want to delete every row for which each cell in column A = Bob. Thanks
Welcome to the forum.
If you search the forum, for delete rows, you'll find dozens of examples, e.g., http://www.excelforum.com/excel-prog...ting-rows.html
Entia non sunt multiplicanda sine necessitate
Hello NoIdeaWhatsoever,
Welcome to the Forum!
This macro will delete all the cells in column "A" starting at row 2. The macro looks for the word "Bob" (case is ignored) and then deletes all rows that contain it. You can change the starting point by changing the starting address of the search. You can also change what to look for. These are marked in red in the macro.
Adding the MacroPlease Login or Register to view this content.
1. Copy the macro above pressing the keys CTRL+C
2. Open your workbook
3. Press the keys ALT+F11 to open the Visual Basic Editor
4. Press the keys ALT+I to activate the Insert menu
5. Press M to insert a Standard Module
6. Paste the code by pressing the keys CTRL+V
7. Make any custom changes to the macro if needed at this time.
8. Save the Macro by pressing the keys CTRL+S
9. Press the keys ALT+Q to exit the Editor, and return to Excel.
To Run the Macro...
To run the macro from Excel, open the workbook, and press ALT+F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Star below the post.3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Please Login or Register to view this content.
Please Read Forum Rules Before Posting
Wrap VBA code by selecting the code and clicking the # icon or Read This
How To Cross Post politely
Top Excel links for beginners to Experts
If you are pleased with a member's answer then use the Scales icon to rate it
If my reply has assisted or failed to assist you I welcome your Feedback.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks