Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jan 2014
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Using VBA to automate pivot table creation

    Hi,
    I am new at VBA and i'd like to know whether such functions are available and if so how am i supposed to do it.
    Lets say,
    i have 5 columns and 1000 rows and i add data filters to to my column therefore giving me this

    Column 1|Column 2| Column 3|Column 4| Column 5|


    If i have 10 different categories in column 1 and i'd to create 10 different pivot tables in seperate worksheets, how am i supposed to go about doing so?

    Thanks
    Harold

  2. #2
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Redditch, Worcestershire, England
    Posts
    233
    Thanks
    0
    Thanked 22 Times in 21 Posts
    Quote Originally Posted by Harold12 View Post
    Hi,
    I am new at VBA and i'd like to know whether such functions are available and if so how am i supposed to do it.
    Lets say,
    i have 5 columns and 1000 rows and i add data filters to to my column therefore giving me this

    Column 1|Column 2| Column 3|Column 4| Column 5|


    If i have 10 different categories in column 1 and i'd to create 10 different pivot tables in seperate worksheets, how am i supposed to go about doing so?

    Thanks
    Harold
    Usually the best way to learn these things is to record yourself creating a PivotTable with the desired layout on one worksheet. The macro recorder will probably record some redundant code which needs to be pruned, and you will be left with the skeleton of a procedure which you will need to customize.

    The 2 things you will typically need to adjust in the macro are:
    the source data range for the PivotTable
    the output destination for the PivotTable

  3. The Following User Says Thank You to jeremybarker For This Useful Post:

    Harold12 (2014-01-02)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •