Hello,
I'm writing a script that selects certain values on a pivot chart slicer, and based on that sends an email containing the corresponding pivot data and chart. I have to do it for multiple values, which may change depending on version of the file currently in use.
Now I got the functional part of the code working, meaning it selects the correct item on the slicer and creates the email message I want, so I can theoretically do it in blocks, but then I would have to define all the values for the slicer selection in the code, making it highly impractical. I need the code to draw the values for the slicer selection from a range of cells on another worksheet, and this is the part I can't get to work.
The functional segment of the code, looks like this:
Now let's say the values I need to loop through are in Sheets("InfoData").Range("A22:A32")
What I tried to do was:
newSelection = ActiveCell.Value
and the put the whole block in a loop
but It would always return an error at this point
Sheets("Infodata").Cells(x, 1).Select
Strangely enough not the same error every time.
I'm completely lost.
Bookmarks