+ Reply to Thread
Results 1 to 9 of 9

how can i create a macro for creating a pivot table.

  1. #1
    Forum Contributor
    Join Date
    09-18-2008
    Location
    india
    Posts
    158

    how can i create a macro for creating a pivot table.

    Hi,

    I have data in sheet1 called "Daily data" and in the next sheet the pivot should be create and there starts my problem.... I have to put "Region","Function",and "Manager" in the row fileds of Pivot and in column the count.

    I have to put filter on Row Pivot Fileds for Region and unselect all feilds execpt "Stamford" and likewise for Function only "Repo".

    I Have no idea but just recorded a macro is giving an error.

    Please help me out ..would be Highly Appreciated.
    Please Login or Register  to view this content.
    Thanks for any Help....
    Last edited by VBA Noob; 09-18-2008 at 08:30 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441
    Perhaps some detail on the error would help us help you.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    09-18-2008
    Location
    india
    Posts
    158
    Hi Andy,

    Iam begginer to this Macro programming.But iam sure my entire code have some problem and the error is Run time -1004 states "Unable to get the PivotFields property of the PivotTabel class".

    Thanks Very much for your intrest Any.


    Regards,
    Shekar.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441
    which line in your code?

    Perhaps you can post example workbook.

  5. #5
    Forum Contributor
    Join Date
    09-18-2008
    Location
    india
    Posts
    158
    Hi Andy,

    I just tried to record once again the macro.

    Please Login or Register  to view this content.
    Even you can find an attached xls sample file please help on this issue.

    Regards,
    Shekar.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441
    Even you can find an attached xls sample file please help on this issue.
    where would I find this example file??

  7. #7
    Forum Contributor
    Join Date
    09-18-2008
    Location
    india
    Posts
    158
    Hi Andy,

    Please find attached zip file.





    Regards,
    Shekar.
    Attached Files Attached Files

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441
    The data source in your code is incorrect. This means that the fieldnames are also incorrect.

    This change sorts out the problems.
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    09-18-2008
    Location
    india
    Posts
    158
    Brillant thanks very much Andy....

+ 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. pivot table within macro
    By LiamF in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2008, 01:23 PM
  2. Create a pivot table in a macro
    By Excelliarmus in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-04-2008, 12:17 PM
  3. Macro to drill down for pivot table
    By yeaster in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-13-2008, 12:51 PM
  4. Pivot table or macro for stock layout
    By dhbyrne in forum Excel General
    Replies: 10
    Last Post: 09-15-2007, 05:21 PM
  5. macro to open out pivot table results?
    By Bill-E-BoB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-07-2007, 01:26 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