Refresh two specific protected worksheets.

Anonymous
2022-09-12T03:50:03+00:00

This does work. However, I don't need every single worksheet unprotected then protected. The only two worksheets I need to unprotect are "Inbound" and "Data Records".
Thank you,

VBA Code:Private Sub CmdRefresh_click() Call Reset Dim ws As Worksheet On Error Resume Next For Each ws In ActiveWorkbook.Worksheets ws.Unprotect Password:="mozzer" Next ws ActiveWorkbook.RefreshAll For Each ws In ActiveWorkbook.Worksheets ws.Protect Password:="mozzer", _ AllowUsingPivotTables:=True Next ws

End Sub
Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2022-09-12T07:11:39+00:00

    I just don't understand why the user form thinks I'm skipping the date block. So frustrating. I'm still working on it.

    Place breakpoints in each sub in your form, run the form and you can see where and when it stops. Debug the code and you'll what's going on behind the scene.

    Andreas.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2022-09-12T04:43:44+00:00

    I think that works, it does so far, thank you so much for "Everything". I'm still having problems with the other part of the refresh button. I know you given me tips, but I'm struggling, it's not from stupidity. I just don't understand why the user form thinks I'm skipping the date block. So frustrating. I'm still working on it.

    Was this answer helpful?

    0 comments No comments