Yeah basically I connect excel to SQL to pull commissions. My macro updates a pivot table with each sales rep on it so normally about 10-20 sales reps. From there he has to click on each of the sales rep to show the data. I wanted to include in the macro to automatically create a sheet for each sales rep (instead of him clicking on it) then automatically save it whatever the sales rep name is then put it in a specified folder. Not sure if that is possible at al.
Main Topics
Browse All Topics





by: sebastienmPosted on 2007-06-15 at 17:35:33ID: 19296523
Hi Brian,
.showpages activesheet.pivottables(1) .pagefield s(1)
Not sure I understand you question, specially the Pivot Item... Do you mean the pivot has a Page field and you to show the pivot for each item of the Page field and each time send the ouput to a new sheet?
If so, there used to be a Show Pages button which would do almost that.
Clicking that button would create one pivot table per sheet based on the main one... one for each item of the page field.
I cannot find the Show Pages anymnore, but the following code would do the same on the first page field of the first pivot of the active sheet. Try in the Immediate window,
activesheet.pivottables(1)
Now, that may be a bit too much if you have many items in that page field but that may get you going.
Regards,
Seb