Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Make name Generic

I'd like to use this macro on many spread sheets. However, this part of the code contains a name
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:=
"FEB2004_Cook!R10C1:R69C14").CreatePivotTable TableDestination:="",
TableName:="PivotTable2", DefaultVersion:=xlPivotTableVersion1
It's calling out the work sheet FEB2004_Cook. I tried activeworksheet and some other ways but to no avail.
Any help
Thanks
DJ
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Make name Generic

Duncan,

U*ntested, but

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
Activesheet.Name & "!R10C1:R69C14").CreatePivotTable
TableDestination:="", _
TableName:="PivotTable2", DefaultVersion:=xlPivotTableVersion10

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duncan J" wrote in message
...
I'd like to use this macro on many spread sheets. However, this part of

the code contains a name.
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"FEB2004_Cook!R10C1:R69C14").CreatePivotTable

TableDestination:="", _
TableName:="PivotTable2", DefaultVersion:=xlPivotTableVersion10
It's calling out the work sheet FEB2004_Cook. I tried activeworksheet and

some other ways but to no avail..
Any help,
Thanks,
DJ



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Make name Generic

Thanks Bob seems to be working fine...

Thanks A lot!
DJ
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
Generic Macro WildWill Excel Discussion (Misc queries) 7 February 2nd 10 02:21 PM
Define a generic name Nelson Excel Worksheet Functions 3 July 17th 09 10:01 PM
If statement with generic value Blessedx3 Excel Worksheet Functions 5 December 19th 08 07:21 PM
HOW TO RETRIVE LAST NAME USING EXCEL, IT SHOULD BE GENERIC zomex Excel Worksheet Functions 5 November 29th 05 03:36 PM
Generic Macro Steve Excel Programming 3 January 22nd 04 09:03 PM


All times are GMT +1. The time now is 07:19 AM.

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"