Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to use value into userform... (2000 sr 1)

    ... i have userform with a listbox filled with valriuos items...
    if i hide or unload userform is possible to use the value of items into listbox?

    wath is the command?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: How to use value into userform... (2000 sr 1)

    You can store it in a cell or a variable (global) before you unload it: or after you click on it:

    <pre>Worksheets(1).Range("A1") = ListBox1.Value</pre>

    or
    <pre>sValue = ListBox1.Value</pre>




    Steve

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to use value into userform... (2000 sr 1)

    ... but if i use thsi command

    myuserform.hide

    the value in listxbox, after this command are still available?

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: How to use value into userform... (2000 sr 1)

    If you hide it, is is still available via code.
    msgbox myuserform.listbox1.value

    or put into a variable
    dim sVariable as string
    sVariable = myuserform.listbox1.value

    Note: If you unload the userform (which was part of what you asked initially) it is not available in code and must be stored somewhere before unloading it.

    Steve

Posting Permissions

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