Thanks Chap's.
That works a treat, but it doesn't solve my problem as i thought it might.
From my other thread, a macro runs after the password is entered, whether the pass word is wrong or right it still unhides some columns, this then allows the user to type into cells which i didn't want unhidden unless the password was right.
Private Sub CommandButton1_Click()
Const Password As String = "PRESLEY" ' Case sensitive
Dim Pass As String, Msg As String
Dim Ans As Integer
Msg = "Wrong Password" & vbCrLf & "Try Again ?"
Pass = TextBox1.Text
If Pass = "" Then ActiveWorkbook.Close SaveChanges:=False
If Pass <> "PRESLEY" Then
Ans = MsgBox(Msg, vbCritical + vbYesNo, "Password")
If Ans = vbNo Then
ActiveWorkbook.Close SaveChanges:=False
Else
TextBox1.Text = ""
TextBox1.SetFocus
End If
Else
Unload Me
End If
Columns("B:J").Select
Selection.EntireColumn.Hidden = False
Range("E2:F2").Select
End Sub
I thought that by disabling the cross, the password would have to be entered correctly to allow the sheet behind the userform to be typed on, this isn't the case.
this is driving me crazy now
any help guy's, PLEASE!!!!!!!!!
jim