How to clear the blank row between the data such as Row 2 and Row 4?
How to clear the blank row between the data such as Row 2 and Row 4?
Hi alferd,
This is a job for VBA. Here is one of many websites that shows and explains the code:
https://www.automateexcel.com/vba/remove-blank-rows/
The secret is that you must start at the bottom and move up to the top because deleting a blank row moves all rows upIf you start at the top and move down, things get screwed up.
That is why the "Step -1" is needed in most all code that does this.
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
Hi alferd324,
I totally agree with Marc L but if you really need a macro this will do the job:
![]()
Please Login or Register to view this content.
You can start at the first row and move down to the last row but you need to create a range of applicable rows as the code moves down through each row and then deletes them from the created range at the end. This does however add extra lines that are avoided doing the bottom up approach as MarvinP suggests and which I have done here.The secret is that you must start at the bottom and move up
Regards,
Robert
Last edited by Trebor76; 03-22-2020 at 08:20 PM.
____________________________________________
Please ensure you mark your thread as Solved once it is. Click here to see how
If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post
If really a VBA procedure is needed - easy with the Macro Recorder - it requires only an unique codeline using a sort
so without any useless looping code …
Thank you for all of your help
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks