Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Delete all pivot tables on a sheet

I make a copy of a sheet containing a number of pivot tables and then
try to delete the existing pivot tables on the new sheet with:

Sub PivotTableClearActiveSheet()
Dim p As PivotTable

With ActiveSheet
For Each p In .PivotTables
p.TableRange2.Delete
Next p
End With
End Sub

I get the following message:

Run-time error '1004':
You cannot change , move a part of, or insert cells ...

Any clues as to what I'm doing wrong.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Delete all pivot tables on a sheet

Should have been

p.TableRange2.Delete xlShiftUp

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
(2) Pivot Tables on the Same Sheet to have the same Page Field Havenstar Excel Discussion (Misc queries) 0 March 11th 09 01:24 PM
2 Pivot tables on 1 sheet TheRook Excel Discussion (Misc queries) 1 June 14th 06 01:01 PM
2 pivot tables in one sheet Dennis Cheung Excel Programming 0 September 19th 05 11:14 AM
Can I permanently delete/hide data within Pivot Tables? Peter Charts and Charting in Excel 1 July 28th 05 12:39 PM
How can I delete rows from Pivot Tables in Excel 2000 as in 97 Rex at B$4U Excel Discussion (Misc queries) 0 April 18th 05 04:55 AM


All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"