Text boxes in userforms (VBA)
Text boxes in userforms (VBA)
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Text boxes in userforms (VBA)

  1. #1
    Board Regular Stubby's Avatar
    Join Date
    Mar 2002
    Location
    Lat 51 23.3 mins North Long 0 24.7 Mins West
    Posts
    186
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Can any help me with this problem. I have a userform created in VBA which collects numeric data via a text box. However when I post the values from the text box they appear as text not numbers. What code do I need to stop this as its driving me up the wall!!

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    Excel has many Conversion function, such as

    CInt(), cLng() and Cdbl()

    But you should just be able to parse the text number to a numeric variable such as:

    Dim iMyNumber as Integer
    iMyNumber=TextBox1.Value

    Also the default Property for a Textbox is Text, so if just use: =TextBox you are parsing Text.



User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

DMCA.com