I am trying to write code to automatically select the Source Data for a pivot table (the Source Data is in an Excel worksheet).
I used: Let MySource = ActiveCell.PivotTable.SourceData
to get "Data!R4C1:R792C99"
I cannot for the life of me now figure out how to *select* that worksheet and range. I have tried parsing the string so I can use the form:
Sheets("Data").Select
Range(Cells(4,1),Cells(792,99)).Select
It works, but seems an unnecessary bit of coding to get there and I have now found I cannot figure out how to handle a Sheet Name which includes spaces.... grrr...
I am sure there must be an easier way, but I'm pretty new at this (first post!)
Thank you for any advice.
Bookmarks