+ Reply to Thread
Results 1 to 6 of 6

Run Macro when slicer selection changes

  1. #1
    Registered User
    Join Date
    07-31-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    63

    Run Macro when slicer selection changes

    What code do in need to run a macro any time the value of a cell changes?
    Last edited by Pony08; 01-05-2016 at 03:26 PM.

  2. #2
    Forum Expert
    Join Date
    03-13-2004
    Location
    Gothenburg/Stockholm, Sweden
    MS-Off Ver
    Excel 2003, Excel 2007 & reluctant Excel 2010 user
    Posts
    4,544

    Re: Run Macro when slicer selection changes

    You could try something like this perhaps

    Please Login or Register  to view this content.
    Alf

  3. #3
    Registered User
    Join Date
    07-31-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    63

    Re: Run Macro when slicer selection changes

    Thx! That works well if I type in a new number...I have a macro that I want to run if a cells that has a formula in it...and the results from the formula changes...I think the fact that the formula stays the same, the macro will not run until I overwrite the formula with just a number.

    Thoughts?

  4. #4
    Forum Expert
    Join Date
    03-13-2004
    Location
    Gothenburg/Stockholm, Sweden
    MS-Off Ver
    Excel 2003, Excel 2007 & reluctant Excel 2010 user
    Posts
    4,544

    Re: Run Macro when slicer selection changes

    Well if the change is based on a formula then you could try this:

    Right click on the sheet tab where the cell is you want to capture a change in. Click "View Code" and paste this code in the window. Say it's sheet1

    Please Login or Register  to view this content.
    Then to the left in the Visual Basic Window you see a number of work sheets and "ThisWorkbook".

    Right click on "ThisWorkbook" and paste this code in the new window.

    Please Login or Register  to view this content.
    Save file and open it again. Now try to update you formula target cell and see if macro runs.

    Alf

  5. #5
    Registered User
    Join Date
    07-31-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    63

    Re: Run Macro when slicer selection changes

    That worked great Alf...thanks for all your help!!!

  6. #6
    Forum Expert
    Join Date
    03-13-2004
    Location
    Gothenburg/Stockholm, Sweden
    MS-Off Ver
    Excel 2003, Excel 2007 & reluctant Excel 2010 user
    Posts
    4,544

    Re: Run Macro when slicer selection changes

    You are welcome.

    Thanks for feedback.

    Alf

+ 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] Macro to Run when Slicer Selection is Changed (multiple slicers)
    By jcanlas in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-09-2021, 11:41 AM
  2. [SOLVED] Macro to Run when Slicer Selection is Changed
    By MBeedle in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2017, 09:29 AM
  3. [SOLVED] Help with VB Code to pass a selection to another workbook's slicer
    By rv02 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-08-2015, 01:11 AM
  4. Have a cell equal to a selection in a slicer?
    By qlikview in forum Excel General
    Replies: 1
    Last Post: 07-07-2015, 03:00 PM
  5. Limiting a pivot table slicer to one selection
    By behrensf84 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-14-2014, 09:25 PM
  6. Limiting Slicer multiple selection
    By Paul-NYS in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 12-17-2012, 02:58 PM
  7. Slicer Macro - unfilter another slicer on selection
    By chadheins in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2012, 10:41 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