Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this one...
HTH, Bernie MS Excel MVP Sub SavePTMacro() Dim i As Integer Dim j As Integer Dim myB As Workbook With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Name") For i = 1 To .PivotItems.Count .PivotItems(i).Visible = True For j = 1 To .PivotItems.Count If j < i Then .PivotItems(j).Visible = False Next j ActiveSheet.Cells.Copy Set myB = Workbooks.Add myB.Sheets(1).Cells.PasteSpecial xlPasteValues myB.SaveAs ThisWorkbook.Path & "\" & .PivotItems(i).Name & ".xls" MsgBox .PivotItems(i).Name & " has been saved to a new file" myB.Close Next i End With End Sub wrote in message ... Hi, If I want to save as file instead of print out? How can I do it? Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Updating pivot items on 3 pivot tables contained on one sheet | Excel Programming | |||
Updating pivot items in three pivot tables on one sheet via VBA | Excel Programming | |||
Name items in Pivot Tables? | Excel Discussion (Misc queries) | |||
Cycle through Pivot Tables with Pivot Items | Excel Programming | |||
ticked items on Pivot tables | Excel Discussion (Misc queries) |