Empty Cells aren't empty

timetabler

New Member
Joined
Jun 15, 2010
Messages
27
I have web-site generated xls sheet (The site provides online data, I then press the excel icon and it creates and downloads as xls format). - The content appears to be raw (no colouring, or table lines)

The problem is that the cells which are empty are counted by excel i.e. select a2:a5 will count as 4 (bottom right of excel), as does counta(a2:a5).

To troubleshoot: code(a2) returns #VALUE! and ISBLANK(a2) returns FALSE, I have also tried paste special over the top, and also onto a new sheet. I have also searched for similar problems, but the code:
Code:
Sub test()
For Each Sheet In Sheets
Sheet.Cells.SpecialCells(xlCellTypeBlanks).ClearFormats
Next Sheet
End Sub
doesn't fix the problem
The only way I can solve the problem is to go into each cell (individually or in bulk) and press delete.

Is there a quicker way to solve the problem?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
If ISBLANK() returns FALSE, then the cells contain null characters. To remove these "pseudo-blanks" try this small macro:

Code:
Sub ClearEmpties()
Dim rDel As Range, Cel As Range
Dim r As Range
Dim s As Worksheet
For Each s In Sheets
    s.Activate
    Set rDel = Nothing
    For Each Cel In ActiveSheet.UsedRange
        If Len(Cel.Value) = 0 And IsEmpty(Cel) = False Then
            If rDel Is Nothing Then
                Set rDel = Cel
            Else
                Set rDel = Union(rDel, Cel)
            End If
        End If
    Next
    If rDel Is Nothing Then
    Else
        rDel.Clear
    End If
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,217,040
Messages
6,134,146
Members
449,861
Latest member
DMJHohl

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