Thread: Multiple tabs
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Hutchins Tom Hutchins is offline
external usenet poster
 
Posts: 1,069
Default Multiple tabs

Try this:

Sub UnprotectSelectedSheets()
Dim sh As Worksheet, shts
On Error Resume Next
Set shts = ThisWorkbook.Windows(1).SelectedSheets
For Each sh In shts
sh.Select
ActiveSheet.Unprotect
Next
Set shts = Nothing
End Sub

You will have to modify the Unprotect statement if the sheets are password
protected.

Hope this helps,

Hutch

"EMN" wrote:

I would like to run a macro to unprotect several worksheets. I would like
the user to select the worksheets that need to be unprotected and run the
macro to unprotect them.

Sub test()
'
' test Macro
'
ActiveSheet.Unprotect
End Sub

How do I make ActiveSheet the selected sheets?

Thank you !!!!!!