Hello everyone. I have (hopefully) a quick issue. I would like to go through or "loop" through the cells in column "L" of my worksheet. If the string "Net", occurs in a cell. I want to delete the entire row above that cell.
Any help is appreciated.
Hello everyone. I have (hopefully) a quick issue. I would like to go through or "loop" through the cells in column "L" of my worksheet. If the string "Net", occurs in a cell. I want to delete the entire row above that cell.
Any help is appreciated.
Last edited by AnthonyWB; 07-28-2011 at 12:38 PM.
1) Assuming column Z is empty, put this formula in Z2 and copy down:
=ISNUMBER(SEARCH(L3, "Net"))
2) Highlight column Z and turn on the Data > Filter > AutoFilter
3) Filter column Z for TRUE
4) Delete all visible rows
5) Turn off the Autofilter and clear column Z
You can record that into a macro, but it's pretty fast as it is by hand.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
JB thank you. I need however to have this running in a prexisting macro. (see code below) . The spreadsheet(s) in question are made on the fly by the code. So I cannot aply your aproach.
JB, i would like to fit this into here;
![]()
Please Login or Register to view this content.
JB,
I found this that you had done for a previous poster
However I need to delete the row above the cell that pocesses the criterion.![]()
Please Login or Register to view this content.
I would use the technique already described in post #2. That can be recorded into a macro in seconds, code you can then add to your existing macro.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks