+ Reply to Thread
Results 1 to 4 of 4

Recorded Macro Does Not Work

  1. #1
    Registered User
    Join Date
    03-23-2012
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    4

    Recorded Macro Does Not Work

    Hi, I recorded a macro, but it always gets stuck at the command shown in red:

    Please Login or Register  to view this content.
    Please let me know as to how I can fix this (attached is the entire macro, I highlighted the command that does not work, which is the first command on page 5). Thank you!
    Attached Files Attached Files
    Last edited by Paul; 05-29-2012 at 07:33 PM. Reason: Added CODE tags for new user. Please do so yourself in the future.

  2. #2
    Forum Contributor
    Join Date
    05-25-2012
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    194

    Re: Recorded Macro Does Not Work

    Nevermind, looked at your attached file - can you attach your actual workbook, rather than just the code itself? More than likely Pivot Field "Division" doesn't exist under Pivot Table "PivotTable32" or PivotTable32 is on a different sheet than PivotTable1. (e.g. not the activesheet). Try replacing
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    .
    Last edited by Paul; 05-29-2012 at 07:35 PM.

  3. #3
    Registered User
    Join Date
    03-23-2012
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Recorded Macro Does Not Work

    Hi MedPack, I tried to attach the workbook, but I guess the file size was too big (over 6MB), so the upload was not successful. The file contains 6 pivot tables on the same sheet, and the objective of the macro is to change the criteria of "Division" and "Bus Type" in each pivot table. The macro works for the first pivot table, but then gets stuck when it comes to the 2nd one. Let me know if I can send the attachment to your personal email if you still need to see the actual workbook.

    Thank you for looking into this for me!

  4. #4
    Registered User
    Join Date
    11-05-2008
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    67

    Re: Recorded Macro Does Not Work

    I hope that you have fixed yoru problem, but it sounds as if your changes are causing the Pivot tables to overlap each other which causes an error, but one that the code generally cannot show whilst in "step through" mode.

    Try giving your pivot tables more room on the sheet, or move them to seperate sheets and then address them like medpack has suggested.

    hope this helps.

    Iain

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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