try this
(change TextBox1 with yr textbox name...)
Private Sub cmdOverride_Click()
Dim Pword As String
Dim lrow As Long
Pword = InputBox("Please input the password. ", "Change Date")
If Pword = "" Then
Exit Sub
ElseIf Pword <> "z" Then
MsgBox "Your password is wrong!", , "Sorry"
Exit Sub
Else
With Sheet7 'find next empty row using Column A
NextRw = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
Dim Wks As Worksheet
.Cells(NextRw, 2).Value = Now
.Cells(NextRw, 2).NumberFormat = "dd-mm- hh:mm"
.Cells(NextRw, 3).Value = Me.TextBox1.Value
.Cells(NextRw, 4).Value = Me.TextBox2.Value
.Cells(NextRw, 5).Value = Me.TextBox3.Value
End With
End Sub
Bookmarks