+ Reply to Thread
Results 1 to 14 of 14

Multiselect ListBox can't find the name

  1. #1
    Forum Contributor
    Join Date
    03-09-2009
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    128

    Multiselect ListBox can't find the name

    Hi,

    I have a sheet named "Main" and multiselect listbox in this sheet.

    I've named the multiselect listbox "Test", in the window just above the column A, next to the formula/cell value input field

    However when trying to run a macro which is to return the selections in the multiselect listbox. I get an error i the VBA code that "object required".

    Please Login or Register  to view this content.
    What I want the macro to do is bascially. Output for each option in the listbox either TRUE or FALSE. Where the first should be outputted in cell A1, then B1, C1, etc..

    I will then use the input created in these cell, for a later procedure..

    Hope someone can shed some light on this...

    PS!! I'm using Excel 2007 and Vista

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Multiselect ListBox can't find the name

    Assuming that is in the worksheet code module, when you click the left hand dropdown above the code module in the VBEditor, does Test appear as an object?
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    03-09-2009
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Multiselect ListBox can't find the name

    I'm not sure I understand where I am supposed to look for what you ask.

  4. #4
    Forum Contributor
    Join Date
    03-09-2009
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Multiselect ListBox can't find the name

    The listBox is in the worksheet by the way

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Multiselect ListBox can't find the name

    When you have that code module open in the VB Editor, there should be two dropdowns at the top of the code window. The one on the left contains the available objects, the one on the right shows the available events/methods for the selected object. If you look for Test in the left hand one, is it there or do you see another name for the listbox?

  6. #6
    Forum Contributor
    Join Date
    03-09-2009
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Multiselect ListBox can't find the name

    I see.

    the only thing I can see is (General)

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Multiselect ListBox can't find the name

    So your code is in a normal module then. If you type Main followed by a period, does the name of the listbox appear in the Intellisense dropdown?

  8. #8
    Forum Contributor
    Join Date
    03-09-2009
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Multiselect ListBox can't find the name

    If I type main in for example in module 1, between the SUb and the End, nothing happens what so ever. Nothing happens if I was to write happens. either...

    Checked that Auto list members are turned on. It is..
    Last edited by ChrisNor; 10-09-2009 at 09:05 AM.

  9. #9
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Multiselect ListBox can't find the name

    Sounds to me as though the code name for your worksheet is not Main at all. Did you just change the tab name or did you alter the code name in the VBEditor?

  10. #10
    Forum Contributor
    Join Date
    03-09-2009
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Multiselect ListBox can't find the name

    Well the name is Sheet23(main) if I write Sheet23. in VB then I get up a lot of options in the combobox. However non have the name Test as I named the listbox

  11. #11
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Multiselect ListBox can't find the name

    If it's a Forms control listbox, try this:
    Please Login or Register  to view this content.
    If it was an ActiveX control, you should see a name like Listbox1 in the Intellisense list.

  12. #12
    Forum Contributor
    Join Date
    03-09-2009
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Multiselect ListBox can't find the name

    I picked the listbox without the activeX controll... Shown I create one with ActiveX?

  13. #13
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Multiselect ListBox can't find the name

    Did you try the code I just posted? It's for the non-ActiveX version of the control.

  14. #14
    Forum Contributor
    Join Date
    03-09-2009
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Multiselect ListBox can't find the name

    Well... I'm off from work now... I'll have to look into this next week.

    I really appreciate your time.

+ 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