Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Forms, TextBox

I tried using a simple assignment function:

Sheets("ShtNm").Range("A1") = UserForm1.TextBox1.Value

.... and got a number. If you want to try something else, try forcing the
conversion of the textbox input to a number using CDbl. ie:

Sheets("ShtNm").Range("A1") = CDbl(UserForm1.TextBox1.Value)

Just be sure to put in appropriate error handling for this in case the user
enters a non-numeric input.

HWH


"Stuart Hodgson" wrote in message
...
I am using a Form to obtain a users input and then taking
those values and inserting them into a spreadsheet. The
problem is that the spreadsheet does not treat the values
as numbers.

I am using activecell.value to insert the values from the
form onto the spreadsheet and have tried using
activecell.numberformat as well as using the onchange
event for the textbox to format the value all to no avail.
If anyone has an answer I would be most grateful.

Many thanks.



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
=EMBED("Forms.TextBox.1","") Lynda Excel Discussion (Misc queries) 1 September 28th 09 03:23 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
TextBox Jimbo1 Excel Discussion (Misc queries) 2 April 20th 06 02:47 PM
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 07:12 AM.

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

About Us

"It's about Microsoft Excel"