- Messages
- 195
- Reaction score
- 0
- Points
- 26
'mga master any idea how to increment vba in excel
Private Sub CommandButton1_Click()
Dim Usname, Pass As String
Usname = Unamebox
Pass = Pwordbox
If Usname = "test1" And Pass = "test" Then
MsgBox "Login Success", vbInformation
Unload Me
i = 1
Else
MsgBox "Access Denied", vbCritical
i = i + 1
End If
If i = 2 Then
ActiveWorkbook.Close
End If
End Sub
Private Sub CommandButton1_Click()
Dim Usname, Pass As String
Usname = Unamebox
Pass = Pwordbox
If Usname = "test1" And Pass = "test" Then
MsgBox "Login Success", vbInformation
Unload Me
i = 1
Else
MsgBox "Access Denied", vbCritical
i = i + 1
End If
If i = 2 Then
ActiveWorkbook.Close
End If
End Sub