View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
John Wilson John Wilson is offline
external usenet poster
 
Posts: 550
Default ActiveSheet.Protect UserinterfaceOnly:=true

Tim,

I'm doing fine.

The last workbook you helped me with is in use and the user loves it.

Good to hear

Thanks for the help.

You're quite welcome

I need to loop through the sheets setting each to :=true.


The following should work:

Sub ProtectAll()
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ThisWorkbook.Worksheets
ws.Protect UserinterfaceOnly:=True
Next ws
Application.ScreenUpdating = True
End Sub

John


Tim Russell wrote:

How are you doing?

The last workbook you helped me with is in use and the user loves it.
Thanks for the help.

As for this new posting, you have also answered it. I need to loop
through the sheets setting each to :=true.

I am writing a macro that copies data from an old file into a new
template that has been updated for ease of use and errors. Both the old
and new files have approx. 32 sheets and I need to copy/paste bits and
peaces from/to each. I am trying not to activate a sheet because, even
though I have set the screen update to false, it still seem to update
the screen. With the code example you gave, I can allow changes to be
made without activating each sheet.

Thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!