Delete all blank cells that are not empty

OldManExcellor

New Member
Joined
May 30, 2011
Messages
45
Is there any way I can find all blank cells that are not empty and delete them?



I use a pivot table with count. The count in pivot table counts blank cells that are somehow not empty. This makes the count pretty useless.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
They had. They were created using an =iferror(primary result, ""). Then I pasted the output from these formulas as values into the column where I now have non-empty blanks.
 
Upvote 0
If you don't mind deleting all thos formulas, then try

Code:
Sub test()
    Set r = ActiveSheet.UsedRange
    Set f = r.Find(what:="", lookat:=xlWhole, LookIn:=xlValues)
    If Not f Is Nothing Then
        fa = f.Address
        Do
            f.ClearContents
            Set f = r.FindNext(f)
        Loop Until f.Address = fa
    End If
End Sub

Before I ran this I had 'blank' cells but specialcells(xlcelltypeblanks) didn't pick anything up, afterwards, it did.

PS pivot tables are a pain when it comes to dealing with blank cells. Maybe you could try forcing the cells to error instead, see what effect that has.
 
Upvote 0

Forum statistics

Threads
1,224,520
Messages
6,179,270
Members
452,902
Latest member
Knuddeluff

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