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

Anyone,

I need to assign a name to one of my pivot table columns (The column
will move as users change the page items and such)

so I need excel to find the column figure out the length and assign it
a name so that I can use the name in other functions (conditional
formatting)

Here is what I thought would work:

Worksheets("PSA_Tool").Names.Add _
Name:="Doug1", RefersTo:= _
Worksheets("PSA_Tool").PivotTables("Main").PivotSe lect "'Lon Prem
Bookings Vs Target'", _
xlDataOnly

I get an error telling me it expects end of statement.

Here are the two statements which do work but do not assign a name like
I wanted to:

Worksheets("PSA_Tool").PivotTables("Main").PivotSe lect "'Lon Prem
Bookings Vs Target'", _
xlDataOnly


Worksheets("PSA_Tool").Names.Add Name:="Doug1",
RefersTo:=ActiveArea (Active area gives me a #NA under names)


Any ideas?

Doug

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Pivot Table Macro Help

Debra,

PERFECT! Thanks so much :)

Doug

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Pivot Table Macro Help

You're welcome! Thanks for letting me know that it worked.

wrote:
Debra,

PERFECT! Thanks so much :)

Doug



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

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
Macro on a Pivot Table Lucas B Excel Discussion (Misc queries) 1 December 23rd 09 02:51 AM
Pivot table macro nickd via OfficeKB.com Excel Discussion (Misc queries) 3 July 15th 08 05:34 PM
pivot table macro skippy51 New Users to Excel 2 May 14th 08 01:06 PM
Macro and Pivot Table Prashanta Excel Programming 0 May 26th 04 12:40 PM
Steps from Macro recorder for Pivot table will not run as a Macro Nancy[_5_] Excel Programming 0 April 2nd 04 10:33 PM


All times are GMT +1. The time now is 12:01 AM.

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"