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: 217
Default VBA to Update Pivot Table

Hi,

Can someone help me with my query - I really do not understand why this
doesn't work?!

I have a simple workbook with 2 sheets in in (sheet1 and sheet4).

In sheet1 I have a table of data with 4 fields (Business, PNR, Online,
Tickets).

In sheet4 I have a pivot table running from sheet1 which shows the page
field as business and then a summary of the others below.

I want a list box (validation list) in cell G1 to update the pivot table
page field (business) when I run my macro and I have been using the following
code in a macro:

Sub Alter()
Sheets("Sheet4").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields ("Business Unit
Name").CurrentPage = ActiveSheet.Range("g1").Value
End Sub

....When I run this macro I get the following error and i'm not sure why:

Run-time error '1004':
Unable to get th PivotTables property of the Worksheet class

Any help much appreciated..

Many thanks in advance for your time,


 
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
Pivot Table Update Dale Excel Discussion (Misc queries) 6 October 25th 09 09:00 PM
Pivot Table update johnsail Excel Discussion (Misc queries) 8 March 26th 09 08:55 PM
Pivot Table update Talheedin Excel Discussion (Misc queries) 0 August 23rd 06 11:05 AM
VBA to update Pivot table JR Excel Programming 3 May 15th 06 02:01 PM
PLEASE HELP...How do I update a pivot table with VBA? marthasanchez Excel Programming 0 May 10th 06 02:20 PM


All times are GMT +1. The time now is 02:18 PM.

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"