Help with Macro Code

markster

Active Member
Joined
May 23, 2002
Messages
499
Hello
I need help with a bit of Macro code. I have managed to figure out most of it by recording and trial and error. The only thing I can't figure out is a line of code that should look down A and any blank cells in column A it deletes the entire row. E.g. A7 might be blank so it deletes the entire row, A9 maybe blank so it deletes the entire row. A11 might be blank so it deletes the entire row. Any blank cells may be shaded but that doesn't matter - if there is not a value in an A cell then it should delete the entire row regardless of whether it is shaded or not.

Thanks
Mark
 
Last edited:

Some videos you may like

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

JB2020

Board Regular
Joined
Jul 29, 2020
Messages
75
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
How about
VBA Code:
Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeBlanks).EntireRow.Delete

If you have blank cells at the bottom which that doesn't pick up, you might want to use
VBA Code:
ActiveSheet.UsedRange.Columns(1).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
instead
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,127,885
Messages
5,627,468
Members
416,250
Latest member
darius_rebelo

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
Top