+ Reply to Thread
Results 1 to 4 of 4

Fixing Update Macro

  1. #1
    Registered User
    Join Date
    05-25-2016
    Location
    United States, Texas
    MS-Off Ver
    MS Office 2010
    Posts
    86

    Fixing Update Macro

    Hello,

    I have a dashboard that is linked to about 6 different Pivot Tables. In that dashboard I have about 6 different filters to play with the various charts.

    I have the worksheet protected with the exception to the "Use PivotTable Reports" check box so the user can see their results without messing up the dashboard.

    I put in the following VBA linked to a form control button to be able to refresh the pivot tables and the charts as they input their data, but the problem I'm having is that every time I push the button and the data is refreshed, the "Use PivotTable Reports" check box gets un-checked when the worksheet re protects.

    Is there anything that I can add to fix this problem?

    Sub UpdateAll()
    Dim pt As PivotTable
    With ActiveSheet
    .Protect Password:="MyPassword", UserInterfaceOnly:=True
    For Each pt In .PivotTables
    pt.RefreshTable
    Next pt
    End With
    End Sub

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Fixing Update Macro

    How about ?
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    05-25-2016
    Location
    United States, Texas
    MS-Off Ver
    MS Office 2010
    Posts
    86

    Re: Fixing Update Macro

    Yes that worked.

    Thank you so much!!

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Fixing Update Macro

    You're welcome.

+ 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 needs fixing - copy from one tab and paste to another tab
    By celeazul in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-18-2015, 11:59 AM
  2. Macro fixing background color after using cf
    By Jhon Mustofa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-17-2014, 10:06 AM
  3. [SOLVED] Error handling macro needs help fixing
    By chococ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2014, 08:37 AM
  4. Help please fixing a macro
    By tyleromaha in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2012, 12:07 PM
  5. Need help fixing macro
    By Kb24 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2009, 03:19 AM
  6. [SOLVED] Fixing SSN's with a macro
    By Bruce Martin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2005, 02:05 AM
  7. [SOLVED] Fixing a macro
    By Tim Dolan in forum Excel General
    Replies: 13
    Last Post: 01-18-2005, 11:06 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