sheet protected with passwod

Status
Not open for further replies.

mhemat

New Member
Joined
Apr 14, 2011
Messages
30
The following code is for:
1- Auto numbering
2- To askes "Continue or not"
3- To save the workbook automatically if answered Yes to continue, otherwise to close the workbook.
My questions are:
1- password for the sheet protection is (tfc), no parenthesis. how can i insert my password in the following code?
2- How can I use this formula ONLY for the workbook named (New Participants), no parenthesis. Thank you all

Private Sub Workbook_Open()
Application.DisplayAlerts = False
Dim S As String
If Not MsgBox(" Is this a new participant? ", vbYesNo + vbQuestion, " Administration Asks....") = vbYes Then
bolOpening = True
ThisWorkbook.Close False
End If
Sheets("Identification").Select
ActiveSheet.Unprotect ("Password1")
Sheets("Identification").Range("C3").Value = Sheets("Identification").Range("C3").Value + 1
ActiveSheet.Protect ("Password1")
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Dude, please stick to your Original Post, instead of continuing to start new ones on the same topic.

EDIT: Technically it would be this one, since it seems that's where the whole theme started. That one is open, the rest are closed.
 
Last edited:
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,612
Messages
6,179,890
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top