XXLFormula AI
Pro ProjectHRBeginnerIncludes .xlsm

Attendance Tracker

4.6· 2,860 learners

A lightweight attendance system in a single workbook. Employees check in via a UserForm, the log rolls up to a monthly summary, and PTO days are debited automatically.

Learners
2,860
Duration
2 hours
Difficulty
Beginner
Attendance Tracker.xlsm — VBA EditorFileEditViewInsertFormatDebugRunToolsAdd-InsWindowHelpRun Sub/UserForm (F5)Project — VBAProjectVBAProject (Budget Automation.xlsm)Microsoft Excel ObjectsSheet1 (Transactions)Sheet2 (Dashboard)Sheet3 (Settings)ThisWorkbookFormsfrmCategoryEditorModulesmodBudgetmodChartsmodUtilsClass ModulesclsTransactionProperties — modBudget(Name)modBudget(General) ▾    RefreshBudget ▾1Option Explicit23' Budget refresh — one-click month-end.4Public Sub RefreshBudget()5    Dim wsData As WorksheetwsDash As Worksheet6    Dim lastRow As Longi As Long78    On Error GoTo Fail9    Application.ScreenUpdating = False1011    Set wsData = ThisWorkbook.Worksheets("Transactions")12    Set wsDash = ThisWorkbook.Worksheets("Dashboard")13    lastRow = wsData.Cells(wsData.Rows.Count"A").End(xlUp).Row1415    For i = 2 To lastRow16        Call AddToCategory(wsDash_17            CStr(wsData.Cells(i"C").Value), _18            CCur(wsData.Cells(i"D").Value))19    Next i2021    Application.ScreenUpdating = True22    MsgBox "Budget refreshed."vbInformation23    Exit Sub24Fail:25    Application.ScreenUpdating = True26    MsgBox "Failed: " & Err.DescriptionvbCritical27End SubImmediate — runningRefreshBudget?RefreshBudget › Loaded 218 transactions from 'Transactions' › Categories matched: 12 / 12 › Savings goals recalculated (6 goals) › Trend chart rebuilt in 42 ms Done. 0 errors, 0 warnings.ReadyLn 24, Col 5

Project screenshots

Code preview

Syntax-highlighted VBA — first 14 lines unlocked. Upgrade to view the full project.

attendance-tracker.bas
VBA
1Option Explicit
2 
3' Attendance Tracker — daily check-in with per-employee summary and
4' automatic PTO deduction.
5 
6Public Sub CheckIn()
7 Dim ws As Worksheet, employee As String, today As Date
8 today = Date
9 employee = Application.InputBox("Employee ID:", Type:=2)
10 If employee = "False" Or Len(employee) = 0 Then Exit Sub
11 
12 Set ws = ThisWorkbook.Worksheets("Log")
13 With ws.Cells(ws.Rows.Count, "A").End(xlUp).Offset(1)
14 .Value = today
15 .Offset(0, 1).Value = employee
16 .Offset(0, 2).Value = Time
17 .Offset(0, 3).Value = "Present"
18 End With
19 
20 Call UpdateMonthlySummary(employee, today)
21End Sub
22 
23Public Sub ApplyPTO(employee As String, days As Double)
24 Dim ws As Worksheet
25 Set ws = ThisWorkbook.Worksheets("PTO")
26 Dim r As Range
27 Set r = ws.Range("A:A").Find(What:=employee, LookAt:=xlWhole)
28 If r Is Nothing Then Err.Raise 5, , "Unknown employee: " & employee
29 r.Offset(0, 2).Value = r.Offset(0, 2).Value - days
30End Sub
Locked preview

Unlock XLFormula AI Pro to view the complete project source, download the .xlsm workbook, and generate custom VBA with AI.

Unlock with Pro

Key features

  • Check-in UserForm
  • Per-employee monthly summary
  • Automatic PTO deduction
  • Late / early-out flagging
  • CSV export for payroll

What's included

  • Attendance Tracker.xlsm
  • Sample roster of 20 employees
  • PTO policy template
  • Setup guide (PDF)
Included with Pro

Get this project — and every other one

Every download, every VBA project, every future release for $5.00/month.

  • AI VBA Generator
  • Download Projects
  • Complete VBA Library
  • Lifetime Updates
  • Premium Templates
  • Priority Support

Frequently asked questions

Can employees see each other's records?
No — the summary sheet is protected. Only the HR admin can view the full log.

Related projects