+ Reply to Thread
Results 1 to 7 of 7

Pivot-Table Auto Update Macro

  1. #1
    Registered User
    Join Date
    07-05-2007
    Posts
    20

    Pivot-Table Auto Update Macro

    Hi there, I'm running into problem with a macro that I got from a website: http://www.cpearson.com/excel/pivots.htm

    It works fine for the pivot table but since I'm having a Dynamic Database, everytime my data changes in length; it always popped up with this error:

    "Run time error 1004: The PivotTable field name is not valid. To create a PivotTable report, you must use data that is organized as a list with labeled coloumns. If you are changing the name of a PivotTable field, you must type a new name for the field."

    When I go run debug, one of the code was highlighted in yellow as you can see below.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Any suggestion on how to fix the problem? I'm not an expert in VBA, if somebody have time please explain to me what each line does.

    Thanks heaps
    Last edited by VBA Noob; 07-11-2007 at 03:12 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try

    Please Login or Register  to view this content.
    Also, Auto_Open macros were superceded by the Workbook_Open event
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-05-2007
    Posts
    20
    Hi Roy, thanks for the reply.

    I've tried your code, however it still returns the same error. Any other idea?

    Thanks

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    no errors for me, have you got PivotTables on the Activesheet?

  5. #5
    Registered User
    Join Date
    07-05-2007
    Posts
    20
    Sorry this is a dumb question, but what do you mean by having PivotTables on the Activesheets? I've the pivottables created on a sheet called 'summary', is that what you are actually referring to?

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    The code refers to the Activesheet, the one currently in use when the code is run. If it has no PivotTables the code will fail. Try specifying the correct sheet

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-05-2007
    Posts
    20
    It's wayyy better now..
    Thanks heaps

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1