================================
Private Sub CommandButton1_Click()
ورقة1.Activate
Sheets("ورقة1").Visible = True
Dim username As String
Dim password As String
username = TextBox1.Text
password = TextBox2.Text
Dim x As Integer
x = 2
Do While Cells(x, 1).Value <> ""
If Cells(x, 1).Value = username And Cells(x, 2).Value = password Then
MsgBox "أهلا وسهلا يا " & " " & username, , " برنامج المحاسبة والإدارة"""
Me.Hide
form2.Show
Sheets("ورقة1").Select
ActiveWindow.SelectedSheets.Visible = False
End
Else
x = x + 1
End If
Loop
MsgBox "Please check you username or Password!"
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.SetFocus
End Sub
Private Sub CommandButton2_Click()
Application.Quit
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Cancel = True
End Sub