+ Reply to Thread
Results 1 to 13 of 13

Convert number in text box (user form)

  1. #1
    Registered User
    Join Date
    05-20-2014
    MS-Off Ver
    2016
    Posts
    82

    Lightbulb Convert number in text box (user form)

    convert carton data from unreadable form to text box form (human readable form).
    i use this code =MID(n_combo,11,5)&"-"&MID(n_combo,16,4) but it works if i close the user form and open it.
    can you help me.sample .xlsm

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,543

    Re: Convert number in text box (user form)

    I changed your TextBox1 into a ListBox. OK?
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-20-2014
    MS-Off Ver
    2016
    Posts
    82

    Re: Convert number in text box (user form)

    proo.st.xlsm
    The listbox works perfect, but as i can put it in each of the textbox when i put 20 numbers.
    please can you help.(user form)

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,543

    Re: Convert number in text box (user form)

    Can you elaborate on that. I don't know what you mean by "but as I can put in each of the textbox when I put in 20 numbers."

  5. #5
    Registered User
    Join Date
    05-20-2014
    MS-Off Ver
    2016
    Posts
    82

    Re: Convert number in text box (user form)

    I would like to see instead of 20 numbers only ten in the text box, can u please help me out on that matter, thanks.

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,543

    Re: Convert number in text box (user form)

    Currently you have:
    Please Login or Register  to view this content.
    If you change this line
    Please Login or Register  to view this content.
    to this
    Please Login or Register  to view this content.
    you'll have only the last ten digits in TextBox1
    Is that what you want?

  7. #7
    Registered User
    Join Date
    05-20-2014
    MS-Off Ver
    2016
    Posts
    82

    Thumbs up Re: Convert number in text box (user form)

    bar code.jpghey thanks very much for all your help!!! what i really triying to do its a label that it doesnt have a list box so basically what i need its to scan a bar code and that that when i scaned them the 9 numbers and - this appears betwen the fifht and the fouth numbers im going to send u a picture to give u an idea .... thanks in advanse!!!label.jpg

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,543

    Re: Convert number in text box (user form)

    I am sorry, I don't know the first thing about bar codes and I do not understand your explanations at all.
    Maybe if you take the time to say what you're doing step by step and what happens after each step.
    Something like:
    1) I scan the item.
    2) The scan is entered into Sheet1, cell A1
    etc etc

    or
    When I manually enter a 20 digit number in a textbox I would like to convert that 20 digit number into (whatever)
    I would like to do that for 20 items.

    Both scenarios are probably totally off kilter but, like I said, I have no idea what you have or want.
    Sorry about that.

  9. #9
    Registered User
    Join Date
    05-20-2014
    MS-Off Ver
    2016
    Posts
    82

    Re: Convert number in text box (user form)

    ok here i go : 1 i scan the item that have a bar code of (11111111119999999991) 20 digits to to make like (99999-9999) and show it in the user form (text box) to save it in a data base in the (sheets cell am2) that the name is (n_ 1) and them with the commant button that is like hidden that the name is (connect) use it to print the form....thanks very much for your patiencie and help .

  10. #10
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,543

    Re: Convert number in text box (user form)

    1) I scan an item. This item has 20 digits.
    2) It it scanned into Sheet1, cell ???
    3) Or is that 20 digit number manually entered into a cell?
    4) Or is that 20 digit number manually entered in a textbox on a userform?
    5) The cell where this number is entered into is named n_combo. (Question: why name that cell if this is indeed so)
    6) I then have to use a formula (=MID(n_combo,11,5)&"-"&MID(n_combo,16,4) to extract part of that 20 digit number.
    7) The result of this formula has to be placed in another textbox on the same userform and also placed in the first available free cell in column?? in Sheet??? (or not?)
    8)
    and so on and so on.

    data base in the (sheets cell am2)
    What is the name of that sheet?

    that the name is (n_ 1)
    What is named n_1? Is that a cell or a range of cells?

    and them with the commant button that is like hidden
    explain that in understandable language please.

    that the name is (connect) use it to print the form
    explain that in understandable language please.

    For me to even try to help you, you should not try to explain things in one long sentence without punctuations.
    My english is not good enough to guess what you want.

    You have to remember that you know what you want and you know what you have in front of you. We don't.
    So it is entirely up to you to explain it in such a way that other people understand what you have and what you would like to happen.

    In the meantime, when I have some time, I'll see if I can make any sense out of all of this.
    Sorry about all of this but maybe someone else understands what you want.

  11. #11
    Registered User
    Join Date
    05-20-2014
    MS-Off Ver
    2016
    Posts
    82

    Re: Convert number in text box (user form)

    Am so sorry you can not understand me,
    1) scan the item. This item have 20 digits. I use scanned Gun
    2) it it scanned into the (user form) textbox1 into the sheet1 cell am2.
    3) convert (=mid(am2,11,5)&"-"&mid(am2,16,4) end come back to the same (user form) textbox1.
    Thank you if you understand my English!!!

  12. #12
    Registered User
    Join Date
    05-20-2014
    MS-Off Ver
    2016
    Posts
    82

    Re: Convert number in text box (user form)

    I can use something????

    Private Sub Textbox1_Click()
    Dim x As String
    x = Range("Am2:am" & Cells(Rows.Count, "Am").Offset(, 1).Value
    Me.TextBox1 = x
    Me.TextBox1 = Mid(x, 11, 5) & "-" & Mid(x, 16, 4)
    End Sub

  13. #13
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,543

    Re: Convert number in text box (user form)

    As far as I know, you can't
    That is more or less in the attachment in Post #2
    Instead of a TextBox, that has a ListBox.
    What's wrong with that?
    Do you want to write the TextBox result into a range of cells?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Convert User Form textbox entry to numerical value
    By MeBeMel in forum Excel General
    Replies: 1
    Last Post: 05-12-2014, 12:19 AM
  2. Replies: 1
    Last Post: 08-28-2013, 05:04 PM
  3. User Form Text Box running Function - How to format number?
    By CRIMEDOG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2011, 12:57 PM
  4. User Form Text Box Format to number
    By baisty182 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-03-2010, 12:22 PM
  5. Need to Paste data into User Form fields or convert
    By iturnrocks in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-02-2008, 04:12 PM

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