+ Reply to Thread
Results 1 to 2 of 2

VBA to find last column on a worksheet with a pivot table

  1. #1
    Registered User
    Join Date
    06-07-2012
    Location
    US
    MS-Off Ver
    Excel Office 365
    Posts
    66

    VBA to find last column on a worksheet with a pivot table

    Ok, so I've tried lots of examples to I've ran into a stumbling block. I have a table of data and from that table I created a pivot table. The data table always has a fixed number of columns so no problem there. The pivot table is always placed at the end of the data table, plus one column so I always have a column space in between the data table and pivot table. The number of columns the pivot table could have varies all of the time. What I'm looking for is how to get the last column of the pivot table where all of my grand totals are stored. Everything I've found so far seems to either stop at the space between the data table and pivot table or at a blank cell with in the pivot table. Any ideas?

  2. #2
    Registered User
    Join Date
    06-07-2012
    Location
    US
    MS-Off Ver
    Excel Office 365
    Posts
    66

    Re: VBA to find last column on a worksheet with a pivot table

    Never mind, found the easiest solution below.

    ActiveSheet.PivotTables(1).PivotSelect "'Row Grand Total'", xlDataAndLabel, True

+ 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: 02-11-2014, 02:14 PM
  2. [SOLVED] Pivot Table Summary -- Part #'s do not show in Pivot but data is in worksheet
    By maryren in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-19-2013, 10:51 AM
  3. Replies: 1
    Last Post: 05-10-2013, 02:03 PM
  4. Pivot table error message but can't find the offending pivot table
    By dcoates in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-22-2013, 08:45 AM
  5. Copy, Find and paste between pivot table and worksheet
    By afgi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2010, 01:47 PM

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