String to number

joacro

Board Regular
Joined
Jun 24, 2010
Messages
158
Hi there,

I got a username with a textbox1 on. The textbox will give a value to "C11" on my workbook.

However the workbook shows that I need to convert text to number.

Please help me with this. I need the textbox to give output as a R currency as a number

Thanx in advance

Joacro
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
When you pass the value to the cell, you can wrap it in Ccur to convert it eg:

Code:
Range("C11").Value = Ccur(Textbox1.Value)
 
Upvote 0
Hi Richard,

Thanks for you reply.

on my userform i have an option button. When it is selected all the textboxes update accordingly. I pasted your code to that but get a debug error.

Here is what I did
Private Sub OptionButton5_Click()
If OptionButton5 = True Then
UserForm2.MultiPage1.Pages(1).Visible = False
If ComboBox1.Value = "1" Then
Range("D11").Formula = (TextBox2 * 12)
Range("C11").Value = CCur(TextBox1.Value)
Range("E11").Formula = Range("D11") * 20 / 100
Range("F11").Formula = Range("D11") * 15 / 100
Range("G11").Formula = Range("D11") * 10 / 100
Range("H11").Formula = Range("D11") * 5 / 100
End If
End sub
 
Upvote 0
Where's the debug error (which line) and what is the name of your textbox that contains the value you want to insert into C11?
 
Upvote 0
Hi Richard,
The debug error is in the code you gave me.
My textbox is textbox1

Hope you will be able to help me
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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