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
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