Sorry, to post this i a follow up , i couldn't find " the post new message" button anywhere.
I have problem, i've recorded a macro in Excel. In this macro i also let the pivottablewizard do some work. i works great but just on one file!!
when i open a different file i takes the old sourdata frmo the previous file with which i recorded the macro.
What i would like to, is how to have the pivottablewizard autoselect de data i need within the recorded macro??
Is this clear??
if not please specify.
Greetz.
I know there's a better solution but...
If you check the language of your macro by clicking "tools"-->"macro" then select the macro you recorded and click "edit", you should probably see that the macro's reference for the workbook is the actual name of the original workbook, so that's the only one to which the macro will pay attention. Now I am very bad at scripting so I generally use the following "work around" for this situation.
Give the workbook that actually works with the macro a name that reflects what the macro does, not the data that is contained (e.g. if the macro makes a pivot table then call the workbook "pivot table maker"). Then copy your data into the workbook, run the macro, and either save the resulting workbook as a new workbook with a data relevant title, or cut and paste the elements you want to keep into a new workbook. This way, your macro-containing workbook acts more as a filter than a storage unit.
Hope that helps
If you want the more competent people on the board to pay attention to your post, I would be happy to post it more prominently for you (sorry you dont have the button), just email me and let me know.