Copy the value of a selected item in a slicer to a specific cell

eddieebo

New Member
Joined
Jan 18, 2015
Messages
2
I have a slicer for the months of the year which is linked to a large number of pivot charts across a workbook. On the same page I also have a specific cell, R13, which is linked to autofilters across the same workbook where the value of R13 determines the filtered value for a number of tables. These tables are related to the pivot charts that the slicer is linked to. Moreover, the filter which R13 controls is for the month of the year. That is, if I write 'November' in R13 then in all the linked tables/autofilters the data of those tables is filtered so as to return only results corresponding to the month of November.

I would very much like to know how to simply select the month in the slicer and have that month value also populate R13. So let's say that I select 'December' in the slicer, then I would like 'December' to appear in R13.

If I could directly link a slicer to autofilters then that would be even better. However, all I need is a VBA code that will enable whatever value is selected in the slicer to also populate R13 on the same page the slicer is on.

Any help would be much appreciated. Thank you.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
In case it can be done, this is the filter update code that links to R13:

With ActiveWorkbook
Range("$A$44:$I$33517").AutoFilter Field:=5, Criteria1:=Worksheets("Detail").Range("R13").Value
End With

If it is possible to simply change Criteria1 to whatever is selected in the Month slicer on the sheet "Detail"; that would be fantastic. This might cause an issue though if multiple months were selected on the slicer as it would then need appropriate coding for Criteria2 to Criteria12 so as to appropriately filter by every month selected.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,681
Messages
6,126,191
Members
449,298
Latest member
Jest

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top