• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Code for slicers

Veeru106

Member
Hi,

Looking for a code which can be applied on slicers.

as and when we select something on slicer it should automatically take me to data sheet.

I have post same thing ealier but that was not working.

so looking for support agian.

Thanks
 

Attachments

  • ADDT.xlsx
    212.2 KB · Views: 1
Personally, I don't think it's a good UI design...

At any rate. Since table filtering does not trigger any event on it's own, and slicer does not have selection event.

You will need to set up some trigger. Normally, I'd trigger it on PivotTable update event. However, since this is slicer tied to table... I'd use Worksheet_Calculate() event.

In any out of way cell in Sheet1, enter following.
=A1

It does nothing, but will trigger worksheet calculate event upon table filter operation (via slicer).

Then in Sheet1 worksheet module, add...
Code:
Private Sub Worksheet_Calculate()
    Me.Activate
End Sub

That's it. Now any time a change is made on slicer (selection, clear filter). Sheet1 is activated.

As I've said, I'm not a big fan of this sort of set up as user will be jumped to Sheet1 on every change. Personally, I'd just add a hyperlink/object to jump to and from.
 
I did the same thing...but This is not what is needed....it should wait untill we select everything and then go to Data sheet....attaching updated file..thanks
 

Attachments

  • ADDT.xlsm
    217.4 KB · Views: 2
Like I said, then just add hyperlink or button to jump between sheets.
There is no way of knowing when user have selected all the items. After all, we are not a mind reader.
 
Back
Top