+ Reply to Thread
Results 1 to 2 of 2

Creating Pivot Table with VBA error 1004 Field not valid

  1. #1
    Registered User
    Join Date
    07-19-2017
    Location
    Holland
    MS-Off Ver
    2013
    Posts
    10

    Creating Pivot Table with VBA error 1004 Field not valid

    Hi all,

    I've been searching this forum and the rest of the web for quite some time now but I still haven't found a solution to my problem. I hope someone can help me.

    I get the following error: "Run-time error '1004': The Pivot Table field name is not valid. To create a Pivot Table report, you must use data that is organized as a list with labeled columns. If you are changing the name of the Pivot Table field, you must type a new name for the field."

    On this line of code:
    Please Login or Register  to view this content.
    The solution that is presented everywhere is that there is an empty hidden cell in the header row. I've checked this (multiple times) and this is not true. There are also no indentical cells in the header row. I can produce the pivot table manually, but I will need to perform this for several hundreds of files so I want to automate it.

    This is my entire code:

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Creating Pivot Table with VBA error 1004 Field not valid

    based on the information provided

    The solution that is presented everywhere is that there is an empty hidden cell in the header row
    ^this is correct, the error message you are getting is because it cannot set a field in the pivot table

    now while the error occurs on this line
    Please Login or Register  to view this content.
    the fault would most likely lie here
    Please Login or Register  to view this content.
    Debug this line and see what it provides you
    i can only assume this isnt the exact range you are asking it to draw from
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. excel run-time error 1004 pivot table field name is not valid
    By kentiq13 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2016, 08:36 AM
  2. Error 1004: PivotTable field name is not valid
    By pschris in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-07-2015, 11:27 PM
  3. Error 1004: PivotTable field name is not valid
    By pschris in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-25-2015, 09:38 AM
  4. VBA: Pivot Tables / Error 1004: Pivot Table Not Valid
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-22-2013, 03:54 PM
  5. Pivot table field name not valid
    By Master Traveler in forum Excel General
    Replies: 3
    Last Post: 05-11-2009, 04:18 PM
  6. pivot table refresh - error 1004 - reference is not valid
    By jrussell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2008, 05:08 PM
  7. The Pivot Table field name is not valid,
    By deniseh in forum Excel General
    Replies: 1
    Last Post: 10-21-2005, 09:05 AM

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