+ Reply to Thread
Results 1 to 6 of 6

Change userform texbox value to number after submitting to wks

  1. #1
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Question Change userform texbox value to number after submitting to wks

    You might laugh when you see how easy this is.

    But I have done mutiple google searches and I cant find anything that I understand. I know the answer is easly out there - I just cant understand it.

    When you look at the simple attached userform, how do I make sure that when the value is entered into my worksheet, it it gets entered as a number and NOT text?

    You will see that if they user trys to type text, they automatically get a msgbox saying numbers only - but its when they do enter a number and hit "OK" is when it still gets added as text.

    Please help and thanks in advance.

    Please Login or Register  to view this content.

    And to further add to my request - I want what is submitted to the worksheet to be in a 0.0% format. So if 25.6 is added to the userform, I would like 25.6% to be added to the worksheet.
    Attached Files Attached Files
    Last edited by clemsoncooz; 02-14-2012 at 03:53 PM. Reason: Add to request

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Change userform texbox value to number after submitting to wks

    Hi
    Simply convert the value from the textbox

    Please Login or Register  to view this content.
    Also look at the other different type convertion functions e.g CLng, CDbl, CDec, etc. you may prefer one of them.
    Buran
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Change userform texbox value to number after submitting to wks

    Even better, to avoid dealing with different numeric types use this

    Please Login or Register  to view this content.
    It will convert the number to the proper type

  4. #4
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: Change userform texbox value to number after submitting to wks

    Cool. Thanks buran. That helps!

    What about this request?
    And to further add to my request - I want what is submitted to the worksheet to be in a 0.0% format. So if 25.6 is added to the userform, I would like 25.6% to be added to the worksheet.

  5. #5
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Change userform texbox value to number after submitting to wks

    even better, to avoid dealing with different numeric types use this (also formatting request)

    Please Login or Register  to view this content.
    umeric type

    Val will convert to proper numeric type

    Buran

  6. #6
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: Change userform texbox value to number after submitting to wks

    This is just what I was looking for.

    Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1