+ Reply to Thread
Results 1 to 6 of 6

Changed userform combobox to listbox, unable to get userform to retrieve datasheet values

  1. #1
    Registered User
    Join Date
    12-14-2012
    Location
    Prince Rupert, BC
    MS-Off Ver
    Excel 2010
    Posts
    10

    Changed userform combobox to listbox, unable to get userform to retrieve datasheet values

    I have a basic userform that acts as an interface for supervisors to view/edit/add information to a hidden datasheet. It works fine in its current form, but I wanted to change a couple of combobox drop down lists to listboxes (single selection). The code that would update the userform combobox with existing values from the datasheet will not do the same for the listbox. I'm learning vba as I go and am having trouble figuring out how to fix it.

    Here is the code that currently works with the combobox (WOtype and Craft are the two controls that I want to change to a listbox):

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,626
    What problems are you having?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    12-14-2012
    Location
    Prince Rupert, BC
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Changed userform combobox to listbox, unable to get userform to retrieve datasheet val

    If I leave the code as it is and change the comboboxes to listboxes, I get a run-time error '424': Object required. I've tried various other things that have all been equally unsuccessful - I didn't keep a record of all the other failed attempts or their errors. This is code that works until I change the type of control box.

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

    Re: Changed userform combobox to listbox, unable to get userform to retrieve datasheet val

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

  5. #5
    Registered User
    Join Date
    12-14-2012
    Location
    Prince Rupert, BC
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Changed userform combobox to listbox, unable to get userform to retrieve datasheet val

    worklog.xlsm
    worklogv3.xlsm

    worklog.xlsm is the first one that works.
    worklogv3.xlsm is the one that I've changed the comboboxes into listboxes and doesn't work.

  6. #6
    Registered User
    Join Date
    12-14-2012
    Location
    Prince Rupert, BC
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Changed userform combobox to listbox, unable to get userform to retrieve datasheet val

    I think I've sorted it out.

    When I want to retrieve the listbox values from my spreadsheet to display in the userform, I used this:
    Please Login or Register  to view this content.
    When I want to paste the listbox values from my userform into my spreadsheet, I just used
    Please Login or Register  to view this content.
    as before.

+ 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] filling listbox from userform combobox problem
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 07-13-2013, 03:48 AM
  2. Unable to Detect When UserForm MultiSelect ListBox Selection Changes
    By ShortSword in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-07-2012, 10:49 PM
  3. UserForm listbox/combobox
    By adeleex in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-25-2011, 03:54 AM
  4. Userform One or more options listbox? combobox?
    By starcraftbud in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2010, 11:44 AM
  5. UserForm;comboBox,ListBox
    By samsara in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-03-2009, 06:13 AM

Tags for this Thread

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