+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    10-07-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    6

    Using Macros on ComboBox within the Ribbon

    I use macros to navigate within spreadsheets based on predefined named locations. I was able to assign these "GoTo" macros to buttons on the Ribbon. I am trying to assign the same macros to a ComboBox, but I can't figure out how to do it. Here's the button macro that works fine.

    <button id="rxbtnGoTo_Historicals"
    label="Hist"
    imageMso="AppointmentColor2"
    onAction="rxbtnGoTo_Historicals_Click"/>


    Here's my attempt at assigning the same macro to a ComboBox. However, when I try to validate it, I get this error message: "onChange attribute is not declared".

    <comboBox id = "NavigationDropDown"
    label = "Navigation"
    onChange = "rxcboNavigationDropDown_Click">
    <item id = "rxitemcboGoTo_Historicals"
    label = "Hist"
    onChange = "rxitemGoTo_Historicals"/>

    Can you please tell me what I'm doing wrong or provide some guidance?

    Thanks

  2. #2
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Using Macros on ComboBox within the Ribbon

    I would have thought you just use the onChange of the combo itself (the items don't have one AFAIK) and then in the callback check the text argument (i.e. the selected item) to determine what you should run.
    So long, and thanks for all the fish.

  3. #3
    Registered User
    Join Date
    10-07-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Using Macros on ComboBox within the Ribbon

    What's "AFAIK"? Is having Items necessary?


    BTW, Romperstomper is a good flick.

  4. #4
    Registered User
    Join Date
    10-07-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Using Macros on ComboBox within the Ribbon

    I think I figured it out.

  5. #5
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Using Macros on ComboBox within the Ribbon

    AFAIK = As Far As I Know!
    So long, and thanks for all the fish.

  6. #6
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,447

    Re: Using Macros on ComboBox within the Ribbon

    Quote Originally Posted by DougQval View Post
    I think I figured it out.
    Your post does not comply with Rule 9 of our Forum RULES. If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit. And please never edit a thread in which someone else has responded.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
    Check out the free Excel Toolbar

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)


    Code Tags: Make your code easier for us to read

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.2.0