+ Reply to Thread
Results 1 to 4 of 4

Pivot Table Column Names

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit
    Posts
    3,732

    Pivot Table Column Names

    When I record the creation of a pivot table, and choose for my data source columns A:D, the code recorded for the column selection is similar to this, showing C for columns 1-4:
    Please Login or Register  to view this content.
    I then put that same code back into my macro, looking like this:
    Please Login or Register  to view this content.
    However, when I run my macro, instead of the source being Columns 1-4, the source is column c, rows 1-4. How do I tell my macro I want columns 1-4?

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit
    Posts
    3,732

    Re: Pivot Table Column Names

    Let me rephrase, so maybe someone can steer me in the right direction:

    When I RECORD the creation of a pivot table, and I select columns A-D as my source, the code recorded for that selection is:
    Please Login or Register  to view this content.
    When I PLAY BACK the macro, "'Summary View'!C1:C4" is interpreted as Column C, rows 1-4.

    That's a problem for me, and I don't know how to overcome it.

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Pivot Table Column Names

    Specify the rows. You should not use entire columns for pivot tables.
    Remember what the dormouse said
    Feed your head

  4. #4
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit
    Posts
    3,732

    Re: Pivot Table Column Names

    Okay, so I'd have to include a "lastrow" variable. How do I write my range in creating the pivot? Something like this?
    Please Login or Register  to view this content.

+ 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