Thread: Help on Macro
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bill Renaud Bill Renaud is offline
external usenet poster
 
Posts: 417
Default Help on Macro

Use an InputBox statement to prompt the user, like so:

Sub UnlockAllWorksheets()
Dim strPassword As String
Dim ws As Worksheet

strPassword = InputBox("Enter the password for all worksheets: ", _
"Unlock Worksheets")

For Each ws In ActiveWorkbook.Worksheets
ws.Unprotect password:=strPassword
Next ws
End Sub
--
Regards,
Bill Renaud