+ Reply to Thread
Results 1 to 2 of 2

Creating PivotTables via VBA

  1. #1
    Registered User
    Join Date
    11-11-2009
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    8

    Creating PivotTables via VBA

    Alright, so I'm using a pivot table to count the unique state I have in a column. Pivot table works perfect except for a couple of things.

    1. Can I use VBA to automatically program the pivot table?
    1a. If so, how?
    1b. Reason being, the table is supposed to me each month as a brand new file. If I could use VBA, I could click a macro button and it creates it automatically, along with some other handy features.

    Any ideas?

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Creating PivotTables via VBA

    Hi Muhnamana,

    I'd suggest recording a macro whilst creating a pivot table from your data. You can then review the code created in the VB Editor (ALT+F11) to see how it is done via code. (Although the macro recorder doesn't always record efficient code, it shows you the basic building blocks well enough.)

    Once you have that, ask some specific questions regarding the code that you don't understand or might need to change from time to time.

+ 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