Converting VBA output to Number

MickAtActuarial

New Member
Joined
Nov 19, 2004
Messages
22
My problem is as follows:

I use user forms (VBA) to assign a number to variable i.e. variable = ClaimAmount, number = 1000, which is then sent to a report and a database. When I use that number in calculations using formulae, for e.g Sum, then results is wrong.

The problem is that the number is stored as text, hence I need a way to convert it to number, so that I can make my calculations work.

Please help.

Thank you

Michael
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Excel is quite good at conversions. So ...
Code:
'- top of module
Dim ClaimAmount as Integer  ' or Double etc.
'in code below somewhere
ClaimAmount=TextBox1.Value
 
Upvote 0

Forum statistics

Threads
1,224,269
Messages
6,177,568
Members
452,784
Latest member
talippo

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