+ Reply to Thread
Results 1 to 8 of 8

get values from userform

  1. #1
    Registered User
    Join Date
    12-13-2011
    Location
    farmington MI
    MS-Off Ver
    Excel 2003
    Posts
    81

    get values from userform

    I have hard time to understand how to get values from userform. I know iit is also possibel by input box but I would like to use userforms.

    For example

    Please Login or Register  to view this content.

    Userform1 view code takes me to another page when i double click on it. Could some one give example or code or clue or link. Thanks in advance.

    Var

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: get values from userform

    Hey var, how is anyone supposed to help you when your code sample is
    Please Login or Register  to view this content.
    What's on the user form? Do you want the values from list boxes, combo boxes, text boxes?
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Registered User
    Join Date
    07-23-2012
    Location
    Dayton, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: get values from userform

    are you talking about getting the values from say a userform textbox into a cell?

    if so, that is just

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-13-2011
    Location
    farmington MI
    MS-Off Ver
    Excel 2003
    Posts
    81

    Re: get values from userform

    sorry, I do not have code and trying to understand, how would i be able get values from userform

    Ok , let me explain you better..

    I have a 10 digit file name from which am going to extract 2nd to 8th characters to create new filename. (eg AB12345678 -> B123456). I'm doing this using Mid.

    I would like to add suffix (using userforms) to new filename. (eg B123456 -> B123456_july_auguest). Here _July_august are from textbox userform.

    Just need a hint to go about. thanks-var

  5. #5
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: get values from userform

    I think it may suit you best if you upload a workbook with a before and after of the data that you want altered with the userform. Make sure that the workbook contains no sensitive or personal data and also ensure that there is a userform already made. Don't worry about the code as someone here will be able to figure that out.

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: get values from userform

    The key is the use of Unload vs. Hide

    If you have a button on the userform that executes
    Please Login or Register  to view this content.
    the userform will be unloaded and any entries lost.

    You OK button should use
    Please Login or Register  to view this content.
    which will hide the userform and return ececution to the calling sub, that sub can then read the data from the userform and unload it.

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  7. #7
    Registered User
    Join Date
    12-13-2011
    Location
    farmington MI
    MS-Off Ver
    Excel 2003
    Posts
    81

    Re: get values from userform

    Thanks Mikerickson, now it makes a lot of sense to me. let me give try.. thanks again

  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: get values from userform

    Once you understand what's going on, let me know (PM me) and I can show you some fancy ways of getting data from a form.
    Your initial comparison to an InputBox is apt.
    If the sole purpose of a userform is to get data from the user, one can code things so that the syntax for getting that info is parallel to the syntax for an InputBox.

+ 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