+ Reply to Thread
Results 1 to 3 of 3

Selected Listbox Item to Textbox

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-26-2004
    Location
    Halifax, UK
    MS-Off Ver
    Office 365 v2402
    Posts
    263

    Selected Listbox Item to Textbox

    I have a UserForm containing a listbox with say 10 items in it. I want to be able to select an item from the list box and have the selected item passed dynamically to a textbox on the same userform.

    I have tried writing some code but get errors such as "Compile error: Argument not optional".

    Anyone know how to make this work?

    Thanks
    Last edited by TheRobsterUK; 09-17-2014 at 04:08 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Selected Listbox Item to Textbox

    Can you post the code you tried?

    This code would put the selected item from ListBox1 in TexTBox1.
    TextBox1.Value = ListBox1.Value
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    05-26-2004
    Location
    Halifax, UK
    MS-Off Ver
    Office 365 v2402
    Posts
    263

    Re: Selected Listbox Item to Textbox

    Thanks Norie. Seems I was overcomplicating things. I was trying things like

    textbox.Text = listbox.SelectedItem

+ 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. [SOLVED] Displaying item from a listbox in a textbox with next 2 columns
    By kmakjop in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-25-2014, 08:44 PM
  2. [SOLVED] Display Selected Item in Listbox in Textbox
    By puuts in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-14-2014, 04:19 PM
  3. [SOLVED] Macro to run when item is selected from listbox
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-30-2014, 09:58 PM
  4. [SOLVED] Run 1 macro when any item from listbox is selected
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2014, 09:52 PM
  5. Select listbox item then appear textbox
    By sohaila in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2013, 04:41 AM

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