+ Reply to Thread
Results 1 to 3 of 3

Macro not working on active worksheet

  1. #1
    Forum Contributor
    Join Date
    07-18-2014
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    175

    Macro not working on active worksheet

    I created a macro that I want it to work on the active worksheet, not just on the particular worksheet I created the macro on. Here is how it starts. I assume there is an issue with the "pivotTable4" Thanks for your help.

    ActiveSheet.PivotTables("PivotTable4").PivotFields("CUSTOMER NAME").AutoSort _
    xlDescending, "SALES DOLLARS", ActiveSheet.PivotTables("PivotTable4"). _
    PivotColumnAxis.PivotLines(4), 1

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,962

    Re: Macro not working on active worksheet

    You could try this, if you have one pivottable on the sheet:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    07-18-2014
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    175

    Re: Macro not working on active worksheet

    That worked. Thanks!

+ 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. Macro - to only run on active worksheet
    By ChocksterNo1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-21-2013, 11:48 AM
  2. [SOLVED] Use Template Worksheet and VBA to add a new worksheet to active non macro workbook
    By fbplaya02 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-30-2013, 01:34 AM
  3. [SOLVED] Set active cell in working macro
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2013, 09:54 AM
  4. Macro to edit active chart on active worksheet
    By shlurpee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2011, 04:58 AM
  5. Identify active worksheet in macro
    By mlk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-12-2007, 09:44 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