Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automatically Delete Pivot Table with Macro?


I have a macro where I create a pivot table on a new sheet, then want t
just take the text values of it without the drop down list. What I en
up doing is selecting the current region then copying and pasting i
onto a new sheet, only pasting the values. At the end of the Macro
want to delete the sheet with the Pivot Table on it that I'm not using
Even with a Macro, it still prompts me and makes me click the Delet
Button. It says "Data may exist in the sheet(s) selected for deletion
To permanently delete the data, press Delete".

Is there any way around this so I don't have to click it? I'm makin
this for someone, and it does not make sense for them to hit the delet
button everytime. Either that or if I could make the pivot table an
somehow automatically convert it to text values. I don't want a pivo
table to be seen.

Any thoughts or ideas would be great!

~

--
nbaj2
-----------------------------------------------------------------------
nbaj2k's Profile: http://www.excelforum.com/member.php...fo&userid=3648
View this thread: http://www.excelforum.com/showthread.php?threadid=56302

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default Automatically Delete Pivot Table with Macro?

To prevent the warning messages, set DisplayAlerts to False. Delete the
sheet, then set DisplayAlerts back to True, as follows:

Application.DisplayAlerts = False
Sheets(2).Delete
Application.DisplayAlerts = True

If you would rather convert the pivottable to text, that's easy, too.
1. Select a cell in the pivottable.
2. Select the CurrentRegion.
3. Copy & paste in place as values.

Hope this helps,

Hutch

"nbaj2k" wrote:


I have a macro where I create a pivot table on a new sheet, then want to
just take the text values of it without the drop down list. What I end
up doing is selecting the current region then copying and pasting it
onto a new sheet, only pasting the values. At the end of the Macro I
want to delete the sheet with the Pivot Table on it that I'm not using.
Even with a Macro, it still prompts me and makes me click the Delete
Button. It says "Data may exist in the sheet(s) selected for deletion.
To permanently delete the data, press Delete".

Is there any way around this so I don't have to click it? I'm making
this for someone, and it does not make sense for them to hit the delete
button everytime. Either that or if I could make the pivot table and
somehow automatically convert it to text values. I don't want a pivot
table to be seen.

Any thoughts or ideas would be great!

~J


--
nbaj2k
------------------------------------------------------------------------
nbaj2k's Profile: http://www.excelforum.com/member.php...o&userid=36480
View this thread: http://www.excelforum.com/showthread...hreadid=563024


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
trying to delete a row in the pivot table for the pivot chart babs Excel Discussion (Misc queries) 3 April 2nd 23 07:10 PM
Macro To Delete Filtered Pivot Table Data Roger[_21_] Excel Programming 0 June 1st 06 04:58 PM
How do I set up a macro to automatically delete certain cells? Husker87 Excel Programming 4 September 30th 05 10:05 PM
Delete pivot table Zic[_2_] Excel Programming 2 May 25th 04 02:08 PM
Macro to Refresh Pivot Table AND Delete Old Items Jason K[_3_] Excel Programming 1 September 25th 03 04:41 AM


All times are GMT +1. The time now is 12:09 PM.

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

About Us

"It's about Microsoft Excel"