+ Reply to Thread
Results 1 to 2 of 2

Userform option button starts a loop that searches worksheet and populates listbox

  1. #1
    Registered User
    Join Date
    11-14-2010
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Unhappy Userform option button starts a loop that searches worksheet and populates listbox

    I have a workbook that contains a few lookup sheets and a userform. The userform has 2 option buttons and a listbox on the form as well as a create new button. When you click on an option the listbox should populate with a specific list of items found on a lookup worksheet in the same workbook. When the user selects the item the want from the list box and click create new, a new worksheet with the same of the item is created. The lookup sheet is 2 columns on it, column A is an item code and column B is an item. The usercodes are specific to the type of item so an example would be

    1005 Cups
    1006 Plates
    2001 Towels
    2003 Table Cloth

    The sequence should go like this if possible, the user opens the form via a button on a worksheet. The form opens with a blank list box and two option buttons one labled Serving and another labled Setup. when a user selects for instance serving as an option, a loop searches all items on the lookup sheet for items starting with the number "1". It then puts these items on the listbox. When a user selects for instance cups and hits create new a new worksheet is created titled Cups. I would like to be able to add new items to the item list by typing a code and item name on my lookup sheet at the end of the current list. I would like if possible for the lookup list to take my item and sort it automatically by number so that the form will still work... Thank you!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Userform option button starts a loop that searches worksheet and populates listbo

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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