question

KriCo-4894 avatar image
0 Votes"
KriCo-4894 asked KriCo-4894 commented

Macro for automatic overview of yesterday (with slicers, pivot table and pivot chart)

Hey,

I have a problem with my macro for automatic selecting yesterday (so tomorrow i want an overview of today, or simple day -1).
And this overview has to be in the setup like the attached picture "capture.jpg". So it's a worksheet containing slicers, pivot table and pivot chart.

My current problem is when i run the macro, i get the overview of the entire month instead of only yesterday.

I attached my macro in the picture "macro.jpg".

Could anyone help me with this ?


office-vba-dev
capture.jpg (202.0 KiB)
macro.jpg (63.3 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Does it work if you manipulate this sheet manually, not by macro?

0 Votes 0 ·

1 Answer

KriCo-4894 avatar image
0 Votes"
KriCo-4894 answered KriCo-4894 commented

Everything works when i manually select the date i want... So all the connections between the chart, slicer and table are working.

The macro also work, but when i run the macro it 's selecting everyday before yesterday. Not only yesterday...

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Did you investigate the values of .SlicerItems(i).Name and variables, and did you check if the condition .SlicerItems(i).Name <> myDay works as expected?


0 Votes 0 ·

Hey,

I added the file. Maybe you can test something ...

I tried everything in range of my knowledge, but i don't know what to do anymore ...

So i hope somebody can see what i did wrong ...

https://jmp.sh/gevbjwB

0 Votes 0 ·