top of page

Tools sign-in /out

Logging application with excel vba

Private Sub Exitt_Click()

Unload Userform1

End Sub

 

Private Sub Label5_Click()

End Sub

Private Sub Label6_Click()

End Sub

Private Sub Remarks_Change()

End Sub

Private Sub TextBox1_Change()

TextBox1.Value = Format(Date, "mm/dd/yyyy")

End Sub

Private Sub UserForm_Initialize()

With ComboBox1
.AddItem "Tool A"
.AddItem "Tool B"
.AddItem "Tool C"
.AddItem "Tool D"
.AddItem "Tool E"
.AddItem "Tool F"

End With

 

End Sub


Private Sub ComboBox1_Change()

End Sub

 

Private Sub Enter_Click()

TargetSheet = ComboBox1.Value

  If (ComboBox1.Text = "") Then
        MsgBox "Please choose a tool"
        End
        
  ElseIf (TextBox1.Text = "") Then
        MsgBox "Please Include your name"
        End
        
   ElseIf (TextBox4.Text = "") Then
        MsgBox "Please Include Tool IC name"
        End
        
      Else
      
   End If

Application.ScreenUpdating = False
Worksheets(TargetSheet).Activate

lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row

If ActiveSheet.Range("I1").Value = "1" Then
SignBox.Value = "Sign Out"
MsgBox ("Sign In Successfully")

ElseIf ActiveSheet.Range("I1").Value = "0" Then
SignBox.Value = "Sign In"
MsgBox ("Signed Out Successfully")

Else: MsgBox ("ERRoR 4o4")
     Unload Me

End If


ActiveSheet.Cells(lastrow + 1, 1).Value = TextBox1.Value
ActiveSheet.Cells(lastrow + 1, 2).Value = TextBox2.Value
ActiveSheet.Cells(lastrow + 1, 3).Value = SignBox.Value
ActiveSheet.Cells(lastrow + 1, 4).Value = TextBox4.Value
ActiveSheet.Cells(lastrow + 1, 5).Value = Time()
ActiveSheet.Cells(lastrow + 1, 6).Value = Remarks.Value

 

Worksheets("Main").Activate
Application.ScreenUpdating = True
Unload Me

End Sub

bottom of page