Delete entire row if cell is blank

gripper

Board Regular
Joined
Oct 29, 2002
Messages
176
I have a spreadsheet that I have created several macros to clean up some data but I have one last step that is confusing me.

Part of my other macros has to do with stacking columns from C right into column A one on top of another. Because my columns are uneven when I stack them in Column A there is some empty cells.

I would like to create a macro that will go down the list in column A and if it comes across a cell in Column A that is empty it will delete that entire row so eventually all the data in column A will have no blank cells. The length of that data in Column A is about 8000 maximum. When it is shrunk down and compiled correctly it will be around 4500 row +/-.

There will be data in Column B but that can be deleted if there is no coorisponding data in Column A.

Any help would be greatly appreciated.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Jeffrey - any idea how to get it to skip the first 3 rows - I suppose I could add a space - that way it is not empty
 
Last edited:
Upvote 0
hth

Dave

Code:
Sub DelBlk()
On Error Resume Next
Range([a4], Cells(Rows.Count, "A").End(xlUp)).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
 
Upvote 0
Pls note that this code does use the last used cell in column A as a "marker" to judge where to delete from (A4 to Ax)

If another column (say B) is potentially longer then the code can be adjusted to cater for this

Cheers

Dave
 
Upvote 0
Sorry for the delayed response but JeffreyBrown code worked perfectly. Thanks alot I really appreicate the help.
 
Upvote 0

Forum statistics

Threads
1,224,568
Messages
6,179,572
Members
452,927
Latest member
whitfieldcraig

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top