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: 65
Default Macro Debug on Pivot Table

Hi All,
I have created a macro that i have been using for some time to create a
pivot table.
The macro reads the data from a data tab and creates a pivot table in
another tab.
Ive never encountered this problem until today and its because i specify the
order of the column field and ive hit for the the first time when there are
no matches.
For example, I have a column in my data tab that contains an aging bucket
(0-30 days, 31-60 days, 61 - 90 days etc up to 365+ days).
Because when the pivot table is created my macro does not order these in the
correct sequence in the column area of the Pivot - i.e. it shows them as 0-30
days, then 120-150 days, then 365+ days then 31-60 days etc. I added a macro
statement to order these in the correct order, however when my macro reaches
the following statement, it bugs out:

'ActiveSheet.PivotTables("AgedUSD").PivotFields("A gings").PivotItems( _
"271 - 365 Days").Position = 8

The reason is that there are no items in the data tab that have an age
bucket of 271-365 days and thus it cant build a column.

Basically i need the statement to say if there are no matches skip, if not
order them as requested.
Please help - im totally stuck.
Rob
NB - i 'remmed out this statement and ran the macro which worked.
--
Rob Gaffney
 
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
Looking to remove pivot fields from pivot table via macro S Himmelrich Excel Programming 0 January 16th 09 03:49 PM
Macro on filtering pivot table (pivot fields) = debug markx Excel Programming 2 May 28th 08 09:32 AM
Code for a Macro that allows a Pivot table to be repeatedly run (fora dynamic rows in a table, but static field names) Mike C[_5_] Excel Programming 1 February 11th 08 04:30 AM
Macro Debug tcnichols Excel Programming 4 July 22nd 04 06:18 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 06:11 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"