Dowsey1977
12-08-2005, 08:10 AM
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
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
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:
If Name = "Name1" Then
Call ReadOnly
End If
But it doesn't seem to recognise the Name...any ideas?
ThAnKs in advance!
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
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
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:
If Name = "Name1" Then
Call ReadOnly
End If
But it doesn't seem to recognise the Name...any ideas?
ThAnKs in advance!