+ Reply to Thread
Results 1 to 9 of 9

Macro code to update Pivot table based on criteria

  1. #1
    Registered User
    Join Date
    08-19-2010
    Location
    Kerala, India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Macro code to update Pivot table based on criteria

    Hi Guys

    The Code given below was give to me by a friend, which helps me to update the pivot tables that I have on a sheet, and also helps me to select the month for which i am checking the report. Now what i have done is i put the data on sheet 2 and sheet 3 and all the pivot tables are on sheet 1. after i have done this change i start getting error from
    " ActiveSheet.PivotTables("PivotTable2").PivotFields("Month").CurrentPage = Range("Month") * 1" the line mentioned above. I think it has something to do with either selecting the month or may due to the movement of the pivot to sheet 1. Can somebody help me on this pleaseeeeeeee


    Please Login or Register  to view this content.
    Last edited by pike; 09-30-2010 at 04:35 AM. Reason: add tags

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Macro code to update Pivot table based on criteria

    Hi,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    08-19-2010
    Location
    Kerala, India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Macro code to update Pivot table based on criteria

    I am so sorry for that, since i was posting it from my office, i totally for got about that. usually I do it from my home.
    let me try it again

    Please Login or Register  to view this content.
    I hope that was OKAY

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Macro code to update Pivot table based on criteria

    Thank you.

    Which sheet is the Month range on?

  5. #5
    Registered User
    Join Date
    08-19-2010
    Location
    Kerala, India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Macro code to update Pivot table based on criteria

    I have put a coulm called month on sheet 2 and 3, where the raw data is pasted and then on sheet 1 i have a cell where i insert the list for 1 -12 months, after selecting the value for eg 9 month and run the macro it will show the values for the month of 9

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Macro code to update Pivot table based on criteria

    So the cell named Month is on the same sheet as the pivot tables?
    What is the actual error you are getting? (it may speed things up if you can post a sample workbook)

  7. #7
    Registered User
    Join Date
    08-19-2010
    Location
    Kerala, India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Macro code to update Pivot table based on criteria

    Unfortunately i wont be able to do that now,But i am not getting any error message right now,after changing the month to 8 or 9,that data wont change

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Macro code to update Pivot table based on criteria

    Do you actually have data for those months?

  9. #9
    Registered User
    Join Date
    08-19-2010
    Location
    Kerala, India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Macro code to update Pivot table based on criteria

    NO I dont have it right now, I can do it later may be after few hours

+ 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