Smoakstack
Board Regular
- Joined
- Mar 28, 2011
- Messages
- 79
here is my code
Public Sub Workbook_Open()
Dim nam As String
If Sheet2.Range("Z1") = "" Then
'Input of name
nam = InputBox("Enter your name.", "Summary", "Name")
'Unlock Information
Sheet1.Unprotect Password:=""
Sheet2.Unprotect Password:=""
Sheet3.Unprotect Password:=""
Sheet4.Unprotect Password:=""
Sheet5.Unprotect Password:=""
Sheet6.Unprotect Password:=""
Sheet7.Unprotect Password:=""
Sheet8.Unprotect Password:=""
Sheet9.Unprotect Password:=""
Sheet10.Unprotect Password:=""
If nam = "" Then
Sheets("SUMMARY").Range("A3").Value = "Name"
Else
Sheets("SUMMARY").Range("A3").Value = nam
End If
End if
'Other code below
End Sub
I would like Range A3 to be the initials of the variable nam?
Is there a way to do this?
Public Sub Workbook_Open()
Dim nam As String
If Sheet2.Range("Z1") = "" Then
'Input of name
nam = InputBox("Enter your name.", "Summary", "Name")
'Unlock Information
Sheet1.Unprotect Password:=""
Sheet2.Unprotect Password:=""
Sheet3.Unprotect Password:=""
Sheet4.Unprotect Password:=""
Sheet5.Unprotect Password:=""
Sheet6.Unprotect Password:=""
Sheet7.Unprotect Password:=""
Sheet8.Unprotect Password:=""
Sheet9.Unprotect Password:=""
Sheet10.Unprotect Password:=""
If nam = "" Then
Sheets("SUMMARY").Range("A3").Value = "Name"
Else
Sheets("SUMMARY").Range("A3").Value = nam
End If
End if
'Other code below
End Sub
I would like Range A3 to be the initials of the variable nam?
Is there a way to do this?