+ Reply to Thread
Results 1 to 3 of 3

Macro for Pivot table not working properly

  1. #1
    Forum Contributor
    Join Date
    05-06-2004
    Posts
    117

    Macro for Pivot table not working properly

    Greetings and thank you in advance for all your trouble. The code below creates a pivot table for a set of data that I have. It runs fine except that every time I run it, it creates a new sheet rather than dumping the pivot table in a sheet that I have designated for it called "Pivot Data". Can some one help me to get the code to run without generating a new sheet every time. Also, can some one be so kind as to show me how to adjust the data range so that it is not fixed at 5000 rows - sometimes the data rage is smaller and sometimes it is larger. I thank you for any assistance.
    Sub Pivot()

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try changing

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    Change Book1 to your workbook name and R1C1 (cell A1) to your cell


    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor
    Join Date
    05-06-2004
    Posts
    117
    Thank you very much for the reply. I do appreciate your help. I have changed the code and I am getting a Run time error '5'. Would any one happen to know what this might refer to?

+ 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