Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default textbox ,problems?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default textbox ,problems?

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" wrote in message
...
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 Range
Set c = Worksheets("Sheet1").Range("a2")
c.Value = TextBox1
oh ,i have even formated the excell -cell ,still no luck



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default textbox ,problems?

Scott,

change the line:
c.Value = TextBox1

to:
c.Value = Me.TextBox1.Value

Troy


"scott t" wrote in message
...
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 Range
Set c = Worksheets("Sheet1").Range("a2")
c.Value = TextBox1
oh ,i have even formated the excell -cell ,still no luck



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default textbox ,problems?

if isnumeric(Texbox1.Value) then
c.Value = cdbl(TextBox1.Value)
else
c.Value = TextBox1.Value
End if


--
Regards,
Tom Ogilvy



"scott t" wrote in message
...
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 Range
Set c = Worksheets("Sheet1").Range("a2")
c.Value = TextBox1
oh ,i have even formated the excell -cell ,still no luck



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default textbox ,problems?

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
aauugghhh...#div/o problems & various average formula problems acbel40 Excel Worksheet Functions 5 October 19th 09 05:00 PM
Calculate Textbox value based on another textbox value.doc Tdungate Excel Discussion (Misc queries) 1 February 12th 09 07:11 PM
Calculate Textbox value based on another textbox value Tdungate Excel Discussion (Misc queries) 0 February 12th 09 07:03 PM
Userform Textbox Currency Format Problems Dunce in SC Excel Programming 2 October 27th 03 12:45 AM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 04:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"