+ Reply to Thread
Results 1 to 9 of 9

Excel Macro - Filter button activate on both sheet if activated on one sheet

  1. #1
    Registered User
    Join Date
    09-29-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    27

    Excel Macro - Filter button activate on both sheet if activated on one sheet

    Hi All,

    I have a workbook that has 2 worksheets. I have filter button (macro based) that I have created on both sheets.

    I would like to link these two filter buttons so that if I activate this filter button on one sheet then it automatically activates the filter button on the other sheet.

    Regards

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Excel Macro - Filter button activate on both sheet if activated on one sheet

    Hi umeshbanga,

    If you have the following Macros associated with the buttons:
    a. First Sheet - MacroA
    b. Second Sheet - MacroB

    My first attempt would be to replace the existing Macros with new Macros:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Lewis

  3. #3
    Registered User
    Join Date
    09-29-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Excel Macro - Filter button activate on both sheet if activated on one sheet

    I have tried this does not work.

    My existing macro is below. Are you suggesting in the module I create the above. I have tried but does not work. My other macro is same just for the other sheet and other button. Hope this makes sense.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Excel Macro - Filter button activate on both sheet if activated on one sheet

    Sorry it didn't work. Since your code is sheet specific (i.e. ActiveSheet), both macros probably process the same Sheet. In order to solve your problem, you're going to have to upload a sample workbook that contains at a minimum the two sheets and their macros. There doesn't have to be any data in the workbook, and make sure you delete any proprietary information.

    To upload a sample workbook:
    Click on GO ADVANCED and use the paperclip icon to open the upload window.
    View Pic

    Lewis

  5. #5
    Registered User
    Join Date
    09-29-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Excel Macro - Filter button activate on both sheet if activated on one sheet

    Here it is.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    04-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    198

    Re: Excel Macro - Filter button activate on both sheet if activated on one sheet

    Call the other onclick event and make it true when the other is true... should work if you cant figure it out I will post the answer

  7. #7
    Registered User
    Join Date
    09-29-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Excel Macro - Filter button activate on both sheet if activated on one sheet

    I cant figure it out.

  8. #8
    Forum Contributor
    Join Date
    04-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    198

    Re: Excel Macro - Filter button activate on both sheet if activated on one sheet

    Can you not just do something like this in each of the sections instead of calling the entire onclick event...
    This would go in the True Click of Detailed Notes Onclick Event...

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Excel Macro - Filter button activate on both sheet if activated on one sheet

    Hi umeshbanga,

    Since I only have access to Excel 2003, and some of your commands are not supported by Excel 2003, I had a little bit of trouble. Instead of using your workbook, I made a skeleton copy of your workbook and simulated what you wanted in the attached file.

    The code is supposed to work as follows:
    a. User Clicks an 'Active X Control'.
    b. The normal Event Handler for that control gets activated (e.g. ActiveItemFilterCheckbox_Click().
    c. The normal Event Handler calls Sub ProcessSynchronizedUpdateRequest() which reads the list of routines to be activated (from Sheet 'Settings'). Each routine is activated in turn, EXCEPT the original routine which is only activated once (when originally clicked by the user).


    My data entries and code to implement my solution are as follows:
    a. In Sheet 'Settings' a list of Sheets and Macro names to be synchronized is REQUIRED. For example:
    Please Login or Register  to view this content.
    b. A processing macro is required in an ordinary code module such as 'Module1':
    Please Login or Register  to view this content.
    c. Code has to be added to Event Handler Macros like in the following:
    Sheet 'ProjectandBAU' module:
    Please Login or Register  to view this content.
    Sheet 'SheetX' module:
    Please Login or Register  to view this content.
    Lewis

+ 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. [SOLVED] Worksheet Activate does not run when sheet activated using VBA
    By solnajeff in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-03-2014, 05:40 PM
  2. [SOLVED] Macro/s to create Search Bar to filter to search terms entered activated by Command Button
    By JasonRay in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-08-2013, 03:44 PM
  3. [SOLVED] When sheet is activated, execute macro in other sheet and return to sheet
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2012, 10:50 AM
  4. Macro to activate a filter on another sheet
    By The_jackal in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-30-2008, 10:52 AM
  5. Need help with Macro to run on activated sheet
    By sjsfiji in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2008, 07:41 PM

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