I would like a mcro that will specify a condition in a cell & then delete specified rows based on that condition being true (Ex: If B3 = "", then delete rows 3 thry 39)
I would like a mcro that will specify a condition in a cell & then delete specified rows based on that condition being true (Ex: If B3 = "", then delete rows 3 thry 39)
Try this. Where it says YOUR RANGE HERE just put Range("A:A") or whatever column you need. I have bolded the criteria line. you can base this on a cell value or throw a variable in there that is determined by the user. Let me know if you need some more help getting this to work exactly how you want it.
![]()
Please Login or Register to view this content.
Not really what I wanted. What I am looking foro is a macro where I can specify if cell B3's value ="", delete rows 3 thru 39 & then if cell B40's value="", delete rows 42 thru 78 & then if cell B79's value="", then delete rows 81 thru 117 & then cell B119's value ="", delete rows 117 thru 153. Something like this. 3 thru 39 might be blank, 42 thru 78 has data, 81 thru 117 is blank & 81 thru 117 has data. End result would be specified areas that have data would move up.
oh ok haha
you'll want to work from the bottom up, as deleting entire rows will will change the reference cell. as in if you delete 3 through 39, 42 through 78 now become 6 through 42.![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks