Hi,
I am trying to modify my VBA code in a way so it wont delete selection if selection contains any text or value.
I have bolded the text in my code.
Thanks for any help I can get.Please Login or Register to view this content.
B.
Hi,
I am trying to modify my VBA code in a way so it wont delete selection if selection contains any text or value.
I have bolded the text in my code.
Thanks for any help I can get.Please Login or Register to view this content.
B.
Please Login or Register to view this content.
Last edited by jonathann3891; 09-17-2018 at 08:17 AM.
Try:
Basically, the macro deletes the rows only if the range is blank.Please Login or Register to view this content.
Last edited by Mumps1; 09-17-2018 at 09:21 AM.
You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
Practice makes perfect. I'm very far from perfect so I'm still practising.
Hi,
I tried your code and it works well. Can I modify your code so it deletes empty rows, but not the rows with values or text within range?
It would be nice if it also detects a row that contains value X1 because this row should not be deleted.
And if I run the code for the second time and all the rows in range contains values or text than the messagebox would popup "The rows contains values"
The reason I would like to modify the code is that when sheet contains many blank rows and within that range is just one row that contains text, so I get stuck with empty rows
I hope I explained well.
Thank you for helping.
B.
Last edited by besis; 09-17-2018 at 04:34 PM.
The macro is already designed to delete the entire row. Is it not doing that for you? Is the value "X1" within your range or can it be anywhere on the sheet? I also noticed a typo in my code: Resize(, 5) should read Resize(, 56).
Hi,
The X1 is within range. After correction that you gave me your code works well.
Somehow the code works even if I delete it manualy. I am new at VBA so I got a lot to learn
Thank you very much for your help.
All the best.
B.
You are very welcome.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks