Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pivot Sheet Name Code


Hi Guys

I am automating with VBA a process which creates a pivot table.

The problem i have is that I would like to set the destination of th
new pivot table to a specific sheet instead of "sheet1" (or the nex
number as happens by default). I tried using the option "use existin
sheet" in the pivot sheet creation dialogue box however no VBA cod
appears to be created for assigning the pivot table to a specificall
named pivot sheet. i.e. the new pivot sheet always tries to put itsel
on "Sheet1".

Any suggestions ?

Thanks in advance

--
paz2
-----------------------------------------------------------------------
paz24's Profile: http://www.excelforum.com/member.php...fo&userid=3104
View this thread: http://www.excelforum.com/showthread.php?threadid=50761

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Pivot Sheet Name Code

Paz,


For either the

PivotCache.CreatePivotTable

or the

PivotCaches.Add(....).CreatePivotTable

methods, set the TableDestination property.

Use something like this, if you have sheet's codename, but the user can change the sheet name:

TableDestination:="'" & Sheet4.Name & "'!R2C8"

Or, if you have a named that you are sure is the

TableDestination:="'Sheet Name'!R2C8"

etc..

HTH,
Bernie
MS Excel MVP


"paz24" wrote in message
...

Hi Guys

I am automating with VBA a process which creates a pivot table.

The problem i have is that I would like to set the destination of the
new pivot table to a specific sheet instead of "sheet1" (or the next
number as happens by default). I tried using the option "use existing
sheet" in the pivot sheet creation dialogue box however no VBA code
appears to be created for assigning the pivot table to a specifically
named pivot sheet. i.e. the new pivot sheet always tries to put itself
on "Sheet1".

Any suggestions ?

Thanks in advance.


--
paz24
------------------------------------------------------------------------
paz24's Profile: http://www.excelforum.com/member.php...o&userid=31046
View this thread: http://www.excelforum.com/showthread...hreadid=507617



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
VB code to copy sheet format to another sheet ASU Excel Discussion (Misc queries) 12 August 10th 06 02:37 AM
Sheet protection code conflicts with Pivot Table "auto refresh" KG Excel Discussion (Misc queries) 6 December 21st 05 11:16 PM
Sheet Code Module: copying code to [email protected][_2_] Excel Programming 2 December 14th 04 01:57 AM
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet arunjoshi[_5_] Excel Programming 1 May 2nd 04 03:50 PM
unprotect sheet in code and make sheet visible peach255 Excel Programming 1 August 1st 03 03:28 AM


All times are GMT +1. The time now is 03:55 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"