Display current sheet name being processed in macro
Try your macro altered like this:-
Sub protect()
For n = 1 To Sheets.Count
Sheets(n).protect 'Password:="&PasswordEntered"
Title = "Protecting sheet"
Style = vbInformation
Message = ActiveSheet.Name & " Protected"
MsgBox Message, Style, Title
Next n
End Sub
Mike
"Ann" wrote:
I have the following macro that will protect each sheet in a workbook.
For n = 1 To Sheets.Count
'Sheets(n).Protect Password:="&PasswordEntered"
Title = "Protecting sheet"
Style = vbInformation
MsgBox "Sheet Protected ", Style, Title
Next n
I need to display the sheet name back to the user, can someone suggest how I
do that within the macro along with the msgbox?
--
Thank U and Regards
Ann
|