Macro for Pivot Tables

Hi, I'm having trouble building a macro on pivot tables. I hope some experts 
here can help solve my problem. Any inputs will be greatly appreciated!!

I'm trying to build a macro to refresh data in multiple pivot tables. The 
pivot tables are build below one another, and additional rows are inserted 
between pivot tables. 

When i built a macro to link all tables to the data in the first (master) 
pivot table, I found Excel was refreshing the table based on the exact cell I 
was clicking. This has become a problem since new rows are inserted between 
tables when new data comes in, and pivot tables are no longer at those cells. 
The macro i've built cannot refer to the tables and crashed as a result. 

I was wondering if I can define or use a dynamic name to select a pivot 
table instead of selecting a cell. My colleagues does not know VB and are not 
interested in using codes to solve this problem. I was wondering if this can 
be done simply. 

Hope someone can offer me help. Thanks in advance. 
0
THOMAS1 (129)
3/14/2005 7:51:01 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
484 Views

Similar Articles

[PageSpeed] 3

You can refresh all external data ranges and PivotTables in the active 
workbook, with the following code:

     ActiveWorkbook.RefreshAll


Thomas wrote:
> Hi, I'm having trouble building a macro on pivot tables. I hope some experts 
> here can help solve my problem. Any inputs will be greatly appreciated!!
> 
> I'm trying to build a macro to refresh data in multiple pivot tables. The 
> pivot tables are build below one another, and additional rows are inserted 
> between pivot tables. 
> 
> When i built a macro to link all tables to the data in the first (master) 
> pivot table, I found Excel was refreshing the table based on the exact cell I 
> was clicking. This has become a problem since new rows are inserted between 
> tables when new data comes in, and pivot tables are no longer at those cells. 
> The macro i've built cannot refer to the tables and crashed as a result. 
> 
> I was wondering if I can define or use a dynamic name to select a pivot 
> table instead of selecting a cell. My colleagues does not know VB and are not 
> interested in using codes to solve this problem. I was wondering if this can 
> be done simply. 
> 
> Hope someone can offer me help. Thanks in advance. 


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

0
dsd1 (5911)
3/15/2005 1:03:49 AM
Reply:

Similar Artilces:

selecting cells to produce a pivot table
I have created a macro that inserts a pivot table using some data on sheet1. I thought that the macro would select the entire list of data to produce the pivot each time it is run but I notice in the code that it selects an absolute range and the range will be different each time I run the macro. How can I change the code to tell Excel to select the populated cells in the list from A1 to the end? Using v2003 - thanks PS - I also made a mistake recording the macro and meant for one of the value fields in the pivot table to perform a sum rather than a count is this easy to...

Formula in Table
Not sure if im posting this in the right category; if not apologies... Ive created a pretty straight-forward table to capture training. So one of those fields is "Seats Available" with a number such as 25. Another field is Seats Booked - lets say that value is 20... I want a 3rd field: Seats Left to calculate automatically :) so i thought i could do that when designing the table but i cant see any wayn of doing it... I know it can be done if i pull it into a query On Jan 3, 2:12=A0pm, ant1983 <ant1...@discussions.microsoft.com> wrote: > Not sure if im po...

Macro warning with no macros
I have a workbook that when I try to open it I get the warning tellin me it contains macros and asking whether I want to Enable or Disabl them. I put no macros, no VB scripts, nothing at all in the workboo other than standard Excel formulas and some charts. I developed it i Excel 2002, SP-2, but have moved it back and forth between tw computers, the other which has Excel 97. Regardless of whether Enable or Disable or change the security settings so as not to get th warning, once the workbook is open even if I go t Tools-Macro-Macros... it lists no macros. How can I find out what's cau...

Macro
Can anybody tell me how to kick off a macro automatically as file is opened? Regards ...

Macro
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: intel Hi, I'm thinking of buying Mac: Office 2008, but before I do I want to check that I will be able to download Scritpsmart collection of templates without any glitches: <http://www.bbc.co.uk/writersroom/scriptsmart/faq.shtml> Does anyone know if I can do this? Regards, SP. In article <ee98ff5.-1@webcrossing.caR9absDaxw>, StregaItalia@officeformac.com wrote: > Version: 2008 > Operating System: Mac OS X 10.4 (Tiger) > Processor: intel > > Hi, > > I'm thinking of buying Mac: Of...

Run macro automatically.
How do I make a macro run automatically when a worksheet it is attached to is loaded? right click on the sheet tab>view code>left window worksheet>right window activate -- Don Guillett SalesAid Software donaldb@281.com "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com... > How do I make a macro run automatically when a worksheet it is attached to is > loaded? I am unable to find "activate " when I right click on worksheet. ( i assume that you are referring to the windo...

Help with macro/and or formula?
Perhaps this is a silly question, but i just can't figure out how t format this worksheet. The problem is that a lot of the cells hav numbers in them with negative signs in the back instead of in the fron (ie. 23-) and i was wondering if anyone knew of a macro/formula i coul use to quickly fix this problem for all the cells. I would b extremely grateful. Thanks -- brefed1 ----------------------------------------------------------------------- brefed15's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3557 View this thread: http://www.excelforum.com/showthre...

Attached Toolbars Macros
Excel 2003 I have a custom tool bar, this tool bar has several items, each item is pointing to a VBA code. This tool bar is attached to the worksheet. I've copied this spreadsheet to several computers. After I copied the spreadsheet I decided to rename the spreadsheet, after I renamed the spreadsheet the Toolbar Item's macros were still pointing to the old name, I reasigned each tool bar item to the current spreadsheet, saved the spreadsheet and everything was working on my computer, but when I re-copied the new spreadsheet to other computers and I clicked on the Toolbar Item...

pivot chart add a ligne not in the pivot table
hello, I've a pivot table and the related graph and I would like to add 2 ligne who represents the minimun and maximum value before alarm. I would like to knwo how to create 2 ligne in a chart by vba Thanks You can create a normal chart, based on the pivot table, and include the additional lines in that. On Jon Peltier's site, there are instructions for creating a normal chart from pivot data: http://www.peltiertech.com/Excel/Pivots/pivotcharts.htm And for adding lines to a chart: http://www.peltiertech.com/Excel/Charts/ComboCharts.html#AddLine To create the code, you ...

Protected sheets and running macros
i have a sheet with a macro ran by a normal button at the top. Howeve when i protect the worksheet where ever i click on the sheet the macr executes. Can any one offer any advice on how to stop this? Thanks Robert -- Message posted from http://www.ExcelForum.com hi, i am not able to reproduce the problem, hence i may not be able t provide a panacea for that issue. here is what i suggest. i have a sheet that has a macro that is run when a control toolbo button (that is, not a form button) is clicked. this sheet is protected based on the user logged in. what i have don is to protect t...

Macro to remove rows?
Hi, I receive thousands of rows of data from an extract that comes from a database. The data extract automatically generates page headers that need to be removed, and I would love to automate this process. The headers do have a pattern to them, but I'm not clever enough to figure out a good way to use that to write a macro. The first row of the header starts with hyphens ------------------------------- Then there's a variable number of rows of header data to delete followed by another row of hyphens ------------------------------- Then 2 additional rows that must be deleted. The nu...

Macro Freezes Reading Pane
I have a macro that Sends/Receives Tasks from Project Server into Outlook Tasks. Everything is working fine, except one weird thing that happens. I have the Timer set on the macro and it starts as soon as Outlook starts. The macro gets the tasks from ProjectServer every hour. As soon as the macro starts running the Reading pane freezes in the Inbox. If i stop the macro then Reading pane is back to normal. Can anyone please tell me if there is something I can do in VBA to fix this annoying issue. Thanks a lot ...

Calling on a macro within a macro!
Hey All!! Quick Question - How do you call up a macro within a current macro? I have one big macro and I need it to jump to several other macros when it runs! Does it matter where the other macros are stored or is it better to have them all in one module? Help appreciated Thnx! Hi Mellowe, '=============>> Public Sub Main() 'Your code Call One 'your code End Sub '<<============= '=============>> Public Sub One() MsgBox "Hi from One" End Sub '<<============= > Does it matter where the other macros are stored or ...

insert category Id into Items table
Can some please help me how to insert the ID from Category and Department tables into the Items table. I have the does some one have the correct SQL for this Thank you jm can u explain it further? "jm" wrote: > Can some please help me how to insert the ID from Category and Department > tables into the Items table. I have the does some one have the correct SQL > for this > Thank you > jm ...

shortcut keys to macros
Hi, Is it at all possible to assign shortcut keys to macros in Outlook? Thx, Hans ...

Pivot Table
I create a Pivot table and it work fine. If I update any of the source data, the table result does not change. Do I have an incorrect Option or is this just the way Pivot tables work? You need to right click in the Pivot Table and hit 'Refresh Table', can be done automatically with code, Regards "wal50" <wal50@discussions.microsoft.com> wrote in message news:20A5B1D4-2149-49A0-817B-CA8A0C5BC836@microsoft.com... >I create a Pivot table and it work fine. If I update any of the source >data, > the table result does not change. Do I have an incorrect Op...

help Unable to record Macro !!!!!!!
I want to record a macro in excel.But as soon as I click record Macro it says "unable to record" macro. Got no help in excel help.I do this same thing in word and it's working. Please help It's urgent for me !!!1 Have a look here http://groups.google.com/groups?as_epq=unable%20to%20record&as_ugroup=microsoft.public.excel.* -- Don Guillett SalesAid Software donaldb@281.com "ash" <anonymous@discussions.microsoft.com> wrote in message news:3e0b01c42ae5$45333e00$a401280a@phx.gbl... > I want to record a macro in excel.But as soon as I click > record...

retrieving data from a table on a website
There is a internet page with chemical data : http://spreadsheets.google.com/pub?key=twQ35hFIq-y0N84xQ5l0ICQ&output=html It has chemicals in the first column and proerties in adjacent columns. Is there a way to have a userform lookup a chemical in a textbox from the websites 1st column and then populate other textboxes with the adjacent data from the table? Can anyone help? Thanks, Roger On Jan 18, 9:59=A0am, Roger on Excel <RogeronEx...@discussions.microsoft.com> wrote: > There is a internet page with chemical data : > > http://spreadsheets.googl...

Macro that password protects a sheet
I am attempting to create a macro that can open a protected sheet, change something, and then protect it again. I continue to have an issue with the macro not entering the password. Is this possible to do/fix? Thanks, Ryan ..open password="mypassword" -- Don Guillett SalesAid Software donaldb@281.com "Ryan" <Ryan@discussions.microsoft.com> wrote in message news:D4780ED8-CA1D-4284-97BC-3576160D998E@microsoft.com... > I am attempting to create a macro that can open a protected sheet, change > something, and then protect it again. I continue to have an iss...

Publishing a pivot table
I have a friend who wants to publish a pivot table. We go throught the Excel dialogs to publish and 'Add interacvtivity' with 'PivotTable functionality' but he only gets the table showing with no data. There is also somebody else with a similar problem where the Published web page just contains a placeholder within IE (i.e. the pivot table does not appear in IE). Can anybody help. One alternative is to use the Office Web Components available as a free download from the microsoft office download site. -- Regards, Alvin Bruney [MVP ASP.NET] [Shameless Author plug] The M...

Table Combination with Sorting
I have a workbook with two sheets with customer names and receivable balances from two different divisions (the customer names and balances change daily). Some of the customers are the same on both sheets. I would like to create a third sheet that will list all of receivable balances from both sheets and combine the balances of any customers that are the same in both sheets and then have the balances sorted from highest to lowest. The result in the third sheet will be linked to another report. I currently do this manually - is there a better way using functions? Would pivot tables ...

How do I link one person to another in the same table?
I have a table of Contacts. Some of my contacts know other contacts, and I would like to indicate that in their record. However, for Data Type, I cannot create a drop down list of contacts from within the table to choose from. Any idea how to to this? Or, if this is not possible, can you suggest another way to indicate "who knows whom"? Your contact table ought to look like: TblContact ContactID FirstName LastName etc Then you need am acquaintenances table: TblAcquaintenance AcquaintenanceID ContactID (identifies a Contact) AcquaintedContactID (Ident...

Footer Macro?
Hi Months ago I read a Public Sub Macro that read the selection of a drop down list in a combo box and placed it in the center Footer at the same time it also placed the date in the right Footer and tme in the left footer. I have searched most of the regular sites including this one and cannot find it anywhere --- Can anyone help with my search. Any help much appreciated Cheers ---- Mully ...

Keyboard Shortcut in Macro
Hi all i'v created macro with Keyboard Shortcut Ctrl+b . now i want to change it to Ctrl+z how can i do it . regards Tools-->Macro-->Macros. Select (don't open!) your macro, and hit the Options button. :) ************ Hope it helps! Anne Troy www.OfficeArticles.com "osaka78" <osaka78@discussions.microsoft.com> wrote in message news:1721A458-212D-4446-8209-494A459EE428@microsoft.com... > Hi all > i'v created macro with Keyboard Shortcut Ctrl+b . now i want to change it > to > Ctrl+z > how can i do it . > > regards THE MACRO IS NO...

Macros have been disabled but there is no macro
when I open a specific doc the info bar at the top says "Macros have been disabled", but when I hit Alt+F11 I can't find any VB or a module to remove. Why is it telling me about macros? Other docs don't give me this prompt. I thought I might have to enable macros to see the code. When I enabled macro, it said "do you want to save changes to this doc?" it flickered and came back as if immediately reopened. Any ideas? I could copy and paste the text into a new doc but I'd be interested to be able to strip off this problem. The doc is an internal IT ...