Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: [userform] insert texbox data in a cell AS INTEGER

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    162
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi, I got a userform that works okay.

    Under 1 texbox the following code is nested:

    Private Sub TBL1_Change()
    Worksheets("sheet1").Range("B2").Value = TBL1
    End Sub

    So the data (numeric) from the textbox is pasted in B2.
    It is however very irritating that the data gest pasted in the 'variant' format I want it to be integer (I need to import the excel file in SAS later on.

    Can anyone tell me how to add this condition?? Perhaps this is a real easy one.


  2. #2
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-25 08:14, Dinictus wrote:
    Can anyone tell me how to add this condition?? Perhaps this is a real easy one.
    Yup and it is:


    Private Sub TBL1_Change()
    Worksheets("sheet1").Range("B2").Value = Int(TBL1)
    End Sub


    HTH

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    162
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Ooh thanks so much man!

    cheers

    Din.

Some videos you may like

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
  •