Originally Posted by
Dowsey1977
Hi,
I have a form that shows when I open my spreadsheet.
In this form is a textbox where the user has to enter their name.
The below code outlines what I already have
[VBA]
Dim Name
Name = TextBox1.Value
Unload Me
If Password = "Name1" Then
Sheets("ControlSheet").Visible = True
Sheets("ENTER PASSWORD").Visible = False
Else
If Password = "Name2" Then
Sheets("ControlSheet").Visible = True
Sheets("ENTER").Visible = False
Else
MsgBox "That is not a valid name. Please ensure you do not have CAPS LOCK on because names are case sensitive" & vbCrLf & vbCrLf & _
"Please re-enter your name", vbCritical + vbOKOnly, "Error"
entry.Show
End If
End If
End Sub[/VBA]
What I want to do is put something into the Initialise code of another form so that if Name declared in the above code equals Name1 to call another macro.
So in the other form I have:
[VBA] If Name = "Name1" Then
Call ReadOnly
End If
[/VBA]
But it doesn't seem to recognise the Name...any ideas?
ThAnKs in advance!