VBA How to fetch raw numbers within a table column

Klash Ville

Board Regular
Joined
Sep 19, 2017
Messages
83
Hello everyone, I have the following situation creating me an obstacle:

I have a table column which contains words and numbers. From that same table column, is it posible to create a VBA command Selecting only the numbers within that column while ignoring everything else such as words in this case?

The final result would be a SUM of all these numbers that have been Selected.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Try this, for column "A":-
Code:
MsgBox Application.Sum(Range("A:A").SpecialCells(xlCellTypeConstants, xlNumbers))
 
Upvote 0
Try this, for column "A":-
Code:
MsgBox Application.Sum(Range("A:A").SpecialCells(xlCellTypeConstants, xlNumbers))

Thank you for your answer, although, it's giving me an overflow error and I know why.

Could you provide me a fix on that code for only the visible cells within that column range please?
 
Upvote 0
nvm it's working now.

Code:
    Dim x As Integer
    
    x = Application.Sum(Range("E:E").SpecialCells(xlCellTypeVisible, xlNumbers))
        
    MsgBox x

Thank you so much my friend =)
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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