the code is not written very well. First, don't use "activecell". for
this code to work you need 3 things to happen
1) You need to have a pivot table
2) You need to have the sheet with the pivot table as the active sheet
3) You need to have the active cell on the worksheet select a cell
inside the pivot table.
The line should be like this
from
Set pt=ActiveCell.Pivottable
to
Set pt = sheets("sheet1").Range("A1").Pivottable
--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=187304
http://www.thecodecage.com/forumz/chat.php