+ Reply to Thread
Results 1 to 15 of 15

Menu Bar

  1. #1
    Registered User
    Join Date
    10-08-2016
    Location
    PAKISTAN
    MS-Off Ver
    OFFICE 2010
    Posts
    68

    Menu Bar

    Dear All ,

    I need to create a combo box populated with list of sheets names in the workbook.

    Regards

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Menu Bar

    Try:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    10-08-2016
    Location
    PAKISTAN
    MS-Off Ver
    OFFICE 2010
    Posts
    68

    Re: Menu Bar

    Thanks for your help but code you have provided not worked

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Menu Bar

    Yes, it does. Show me how you're trying to use it.

  5. #5
    Registered User
    Join Date
    10-08-2016
    Location
    PAKISTAN
    MS-Off Ver
    OFFICE 2010
    Posts
    68

    Re: Menu Bar

    I have run code by paste into VBA Module and when run it nothing happened and no error message

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Menu Bar

    You didn't specify where your combobox is, so I gave you a function which populates a specified combobox. You have to call that function as part of your existing code, and specify the combobox object you are referring to.

    For example - if your combobox is on Sheet1, and is called ComboBox1, then you could use:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-08-2016
    Location
    PAKISTAN
    MS-Off Ver
    OFFICE 2010
    Posts
    68

    Re: Menu Bar

    i want to create a combo box like this so that when i click menu then it goes to menu worksheet a snapshot is attached

    The combo box i have created is on sheet 1


    Regards
    Attached Images Attached Images
    Last edited by asad.ermo; 08-15-2017 at 09:10 PM.

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Menu Bar

    It's hard to tell, from an image (much better to attach an actual workbook), but I suspect you've inserted a Form Control Combobox. You'd be better using an ActiveX ComboBox, if you intend manipulating it with VBA.

  9. #9
    Registered User
    Join Date
    10-08-2016
    Location
    PAKISTAN
    MS-Off Ver
    OFFICE 2010
    Posts
    68

    Re: Menu Bar

    Thanks for your help

    I have attached a screenshot of actual workbook

    kind Regards
    Attached Images Attached Images

  10. #10
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Menu Bar

    Yes, as I guessed, you've inserted a Form Control Combobox.

    On the Developer tab, click the Insert dropdown, and you'll see two sets of controls - Form Controls and ActiveX controls. Because you want to control the ComboBox behaviour with VBA, it's better for you to use the ActiveX control.

  11. #11
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Menu Bar

    Attached file will automatically list all worksheets in workbook in a userform. Double Click will take to selected worksheet. Visible from any worksheet makes for easy navigation
    Attached Files Attached Files

  12. #12
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Menu Bar

    @nigelog That's not what OP asked for, though...

  13. #13
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Menu Bar

    Quote Originally Posted by Olly View Post
    Yes, as I guessed, you've inserted a Form Control Combobox.
    That picture shows an ActiveX combobox.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  14. #14
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Menu Bar

    I guess not but someone might find it useful in a multisheet workbook

  15. #15
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Menu Bar

    Quote Originally Posted by xlnitwit View Post
    That picture shows an ActiveX combobox.
    You're absolutely right - my error!

    In which case, the code I posted in #2 and #6 should work just fine:

    Please Login or Register  to view this content.
    To activate the selected worksheet, something like this in the worksheet module:
    Please Login or Register  to view this content.
    See attached workbook for worked example.
    Attached Files Attached Files

+ 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. Replies: 5
    Last Post: 02-17-2017, 04:50 PM
  2. [SOLVED] Losing a custom menu bar within Windows menu bar when new excel session is opened.
    By SCACCHIA in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-17-2014, 04:34 PM
  3. [SOLVED] Trying to 'Grey Out' menu items on Custom Menu if Workbook is ReadOnly
    By TC1980 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-30-2013, 08:22 AM
  4. [SOLVED] Excel 2007 : new drop down menu based on dropdown menu in previous cell
    By martinpols in forum Excel General
    Replies: 3
    Last Post: 04-30-2012, 02:33 AM
  5. Replies: 3
    Last Post: 12-10-2009, 09:30 PM
  6. Replies: 0
    Last Post: 11-24-2005, 09:25 AM
  7. [SOLVED] Menu items added with menu item editor in older versions
    By Michael Hoffmann in forum Excel General
    Replies: 2
    Last Post: 01-07-2005, 10:06 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