textbox ,problems?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i'm try to run a textbox in a userform, to an excel worksheet , using the textbox as a number .problem is that when i send the number to excel worksheet ,it comes in a text form, which the number then won't add ,subtract ,divide ,ect
code is
Private Sub TextBox1_change(
Dim c As Rang
Set c = Worksheets("Sheet1").Range("a2"
c.Value = TextBox
oh ,i have even formated the excell -cell ,still no luck
 
Hi Scott,

It does create a text string in A2, but as it is all numeric, any other math
operations on that cell do an implicit conversion to numeric, so it should
be okay.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

scott t said:
i'm try to run a textbox in a userform, to an excel worksheet , using the
textbox as a number .problem is that when i send the number to excel
worksheet ,it comes in a text form, which the number then won't add
,subtract ,divide ,ect.
 
Scott,

change the line:
c.Value = TextBox1

to:
c.Value = Me.TextBox1.Value

Troy


scott t said:
i'm try to run a textbox in a userform, to an excel worksheet , using the
textbox as a number .problem is that when i send the number to excel
worksheet ,it comes in a text form, which the number then won't add
,subtract ,divide ,ect.
 
if isnumeric(Texbox1.Value) then
c.Value = cdbl(TextBox1.Value)
else
c.Value = TextBox1.Value
End if


--
Regards,
Tom Ogilvy



scott t said:
i'm try to run a textbox in a userform, to an excel worksheet , using the
textbox as a number .problem is that when i send the number to excel
worksheet ,it comes in a text form, which the number then won't add
,subtract ,divide ,ect.
 
I have had the same proble
A work around that I came up with was to put the results in a cell and then use the =value(cell) to convert it to a numeric format
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top