LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Set PivotField to predefined value with check


I'm having a Pivot table in a sheet and I want to set a PivotField at
predefined value when that value exists in the fields list.

The following code works fine but gives an error (-Run-time erro
'1004': Unable to get the PivotTables property of the Worksheet class-
when the predefined value does not exists in the fields list...

How can I transform this into a if-else construction where I check th
presence of the predefined value first? (If predefined value isn'
available then the option '(blank)' should be selected.)


Code
-------------------

ActiveSheet.PivotTables("PivotCC").PivotFields("Cu stomerspecs"). _
CurrentPage = "CC missing"

-------------------

--
s80N
-----------------------------------------------------------------------
s80NL's Profile: http://www.excelforum.com/member.php...fo&userid=3637
View this thread: http://www.excelforum.com/showthread.php?threadid=56159

 
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
PivotField refreshment witek Excel Programming 1 July 13th 06 05:58 PM
PivotField AfterUpdate event? Snowsride Excel Programming 0 January 11th 06 01:12 PM
PivotField select all CinqueTerra Excel Programming 3 December 11th 05 12:55 AM
How can I hide-Unhide pivotfield using VBA? MB Excel Programming 0 March 16th 05 09:57 PM
Hiding a pivotfield using code Todd Huttenstine Excel Programming 1 June 10th 04 05:01 PM


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