+ Reply to Thread
Results 1 to 6 of 6

Create a macro to change pivotable

  1. #1
    Registered User
    Join Date
    10-11-2011
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Create a macro to change pivotable

    I have a pivotable that displays sales data (I have attached the worksheet)

    The problem I am having is that I need to create 2 macros. 1 when you click the button it changes the data to shows the values as % of column total and the 2nd macro to show the data back to its original data (no calculation)

    Can you tell me how to do this, this one is really driving me nuts.

    I have attached the worksheet for you to see exactly what I am talking about

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,368

    Re: Create a macro to change pivotable

    Hi,

    See the attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    10-11-2011
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Create a macro to change pivotable

    Thank you so much for the help. Could you tell me if you created the macro by clicking on "record macro" or by some other means?

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,368

    Re: Create a macro to change pivotable

    Hi,..I.recorded.a.macro.and.then.edited.it.a.little.....Sorry.but.my.space.keyis.broken.

  5. #5
    Registered User
    Join Date
    10-11-2011
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Create a macro to change pivotable

    Can you tell me exactly how you recorded it? If possible step by step?

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Exclamation Re: Create a macro to change pivotable

    @MarvinP,

    Hello Marvin,

    I had a look at this before your post, and thought that it would require much more coding than what you came up with. Nice work!!!

    I am using Office2007, and your code to calculate percentage totals return the monetary symbol, instead of displaying the result as actual %.

    I have added this line to your code, which seems to "fix" the problem.

    Please Login or Register  to view this content.
    Would this only relate to a possible difference between Office 2010 and Office 2007?

    Before I changed your code I have even tried to format all the cells in the Table to %, but that also did not solve the issue.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

+ 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