+ Reply to Thread
Results 1 to 2 of 2

How Do I call a Macro Using the ComboBox Change Event?

  1. #1
    Registered User
    Join Date
    07-20-2011
    Location
    Oakland, CA USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Exclamation How Do I call a Macro Using the ComboBox Change Event?

    I have a macro (Excel 2003) which refreshes a pivot table based upon the value in a cell. This macro runs perfectly on its own.

    Now I want to use a comboBox change event to call my macro when a user selects a different value from a list.

    I've created a combo box and linked it to a list of values (ListFillRange) for the drop down. The combo box is linked to a cell (LinkedCell) which is referenced by the macro. I'm using the following code for the comboBox change event to call my macro ("RefreshPivot").

    Please Login or Register  to view this content.

    When I choose a different item in the combo box, the macro starts to run but fails on the first line of the macro. Since the macro runs perfectly independent of the combo box, I'm thinking my code for the comboBox change event must be wrong. Can anyone tell me if my code should work or help set me straight if I'm doing this incorrectly?

    Thanks!!!!!!!!
    Last edited by Bosco6; 07-24-2011 at 06:12 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: How Do I call a Macro Using the ComboBox Change Event?

    I'm not sure what sort of a response, if any, you are likely to get based on the limited information you have provided.

    A sample workbook with some typical data and the code is the best way to get assistance.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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