Count filled cells

teodormircea

Active Member
Joined
Jan 8, 2008
Messages
331
I have a little problem counting filled(numbers,chars, etc) cells
i used |:
subtotal with filters , nothing
i used COUNTA, nothing
i used COUNTIF(range,"*"), nothing
is still counting the blanks
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Sounds to me like your blank cells aren't truly blank (ie they may have spaces in them which is throwing off the formulas).
 
Upvote 0
Cells which do have data - are there any genuine spaces in these ie spaces between words)? If not, you could simply do a Find/Replace on all the data finding spaces and replacing with nothing (ie effectively removing the spaces).
 
Upvote 0
well i found this trim macros

Code:
Option Explicit
 
Sub TrimXcessSpaces()
     'Macro Purpose: To trim all excess spaces out of cells.  This
     'eliminates issues where users have cleared the cell with a space,
     'and elimates all extra spaces at the beginning or end of a string
     
    Dim cl As Variant
     
     'Loop through cells removing excess spaces
    For Each cl In Selection
        If Len(cl) > Len(WorksheetFunction.Trim(cl)) Then
            cl.Value = WorksheetFunction.Trim(cl)
        End If
    Next cl
End Sub

works nice, but the big problem is it that the date is imported from sql, and the thing is that the is not correctly identify the NULL case from database
 
Upvote 0
and the thing is that the is not correctly identify the NULL case from database

What does this mean? Sorry I am not following you. Are you saying that these cells still have something in them?
 
Upvote 0
I a data base if you have nothing inside in a case it is NULL, well when you export a data base or a table in excel , NULL is blank , but well it isn't
 
Upvote 0

Forum statistics

Threads
1,213,483
Messages
6,113,919
Members
448,533
Latest member
thietbibeboiwasaco

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