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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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,223,767
Messages
6,174,388
Members
452,561
Latest member
amir5104

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