+ Reply to Thread
Results 1 to 3 of 3

Pivot table code

  1. #1
    Forum Contributor
    Join Date
    10-12-2018
    Location
    Leesburg, FL
    MS-Off Ver
    2013
    Posts
    113

    Pivot table code

    I have a pivot table and I am stepping through the categories using the below code... From my understanding, objPivotItem is an object that has properties like name for instance. However, if I display just objPivotItem without the property .Name, I still get the same value. Why is this?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Pivot table code

    Hi,

    I'd bet that .Name is the default property for that object. An example is that you can code a Cell.Value is the same as Cell but you might also want Cell.Address which isn't the default.

    To resolve this question, I'd View my Object Browser and search the Excel functions for PivotItem, PivotFields, etc and see what the possible other properties are. Then in the immediate window I'd try to debug.print those items to see what VBA thinks they are.

    Hope this helps.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    10-12-2018
    Location
    Leesburg, FL
    MS-Off Ver
    2013
    Posts
    113

    Re: Pivot table code

    Quote Originally Posted by MarvinP View Post
    Hi,

    I'd bet that .Name is the default property for that object. An example is that you can code a Cell.Value is the same as Cell but you might also want Cell.Address which isn't the default.

    To resolve this question, I'd View my Object Browser and search the Excel functions for PivotItem, PivotFields, etc and see what the possible other properties are. Then in the immediate window I'd try to debug.print those items to see what VBA thinks they are.

    Hope this helps.
    Thanks MarvinP!

+ 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. Replies: 0
    Last Post: 07-14-2016, 03:51 PM
  2. [SOLVED] VBA Code pivot table filters - Can i add another to my code
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-03-2015, 09:23 AM
  3. [SOLVED] How to get the Pivot Table Value in VBA Code
    By rv02 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-28-2015, 12:27 PM
  4. [SOLVED] VBA code to turn data into pivot table and then into pivot chart
    By Faintkitara in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2015, 09:05 PM
  5. Need a VB Code for Pivot Table instead of using custom format code
    By Linus100 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-02-2014, 01:13 PM
  6. Help with VBA code to find bottom row in pivot table and fill table cell borders
    By Eric111 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-28-2014, 07:15 PM
  7. [SOLVED] VBA Code for a pivot table to open database and to reference table current page
    By Pete Straman Straman via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-21-2005, 12:06 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