⚙️ How to Build a VBA-Based Change Approval System That Tracks and Authorizes Excel Record Modifications

⚙️ How to Build a VBA-Based Change Approval System That Tracks and Authorizes Excel Record Modifications

A finance workbook is shared across a team. A price changes, a supplier status is overwritten, and a deadline moves forward. The spreadsheet still works, but nobody can confidently answer the most useful questions: what changed, who changed it, and was that change approved?

Excel’s standard Undo command is helpful only for the person currently editing the file. It is not an audit trail, and it does not create a controlled approval process. Once a workbook is saved, closed, or passed to another user, informal memory is usually all that remains.

A VBA-based change approval system can add a practical layer of control to the right kind of workbook. It can capture proposed edits, preserve the original values, route changes for review, and apply only the changes an authorized person approves.

This is not a substitute for enterprise workflow software or database security. But for a small operational workbook, a carefully designed VBA solution can turn a vulnerable shared sheet into a more accountable process.

🧭 Define What “Approval” Means in Your Workbook

Approval should be more than a pop-up that asks “Are you sure?” In this design, a user proposes a change, the workbook records that proposal, and an approver decides whether the proposed value may be written to the official record.

That distinction separates an editable request from an authorized change. The source sheet should retain its approved value until approval occurs.

For example, a purchasing coordinator may request a new payment term for a vendor, while a finance manager is the person permitted to authorize it. Both tasks belong in the workbook, but they should not have the same permissions.

🎯 Choose Changes That Actually Need Control

Not every cell deserves an approval workflow. Requiring approval for routine notes, temporary calculations, or harmless formatting creates friction and encourages people to bypass the system.

Start with fields where an incorrect change has a meaningful operational consequence, such as:

  • Customer credit limits and payment terms
  • Supplier bank or tax reference details
  • Employee rate, grade, or cost-center assignments
  • Project budgets, forecast values, and completion dates
  • Inventory reorder points or approved product status

Keep formulas, headings, and helper columns outside the approval scope whenever possible. A narrower scope is easier to test and explain.

🗺️ Map the Workflow Before Writing VBA

A reliable macro follows a clear business sequence. Sketch the sequence on paper first, including who performs each action and what happens when a request is rejected.

  1. A requester selects a record and enters a proposed value.
  2. VBA validates the request and writes it to a pending-change log.
  3. An approver reviews the pending request.
  4. The approver approves or rejects it, optionally adding a comment.
  5. On approval, VBA updates the source record and marks the log entry as applied.

This model avoids an ambiguous state where users are unsure whether a displayed value is proposed, approved, or merely typed into an unlocked cell.

🧱 Separate the Source Data from the Change Log

Use at least two worksheets: one for the official records and one for the audit log. A third sheet for configuration is often useful for lists of approvers, protected columns, and status values.

Suppose the Records sheet holds one customer per row. The ChangeLog sheet can hold one requested edit per row. A log is not just a history sheet; it is the workflow queue.

Worksheet Purpose Typical users
Records Current approved values Requesters and approvers
ChangeLog Pending, approved, rejected, and applied requests Approvers; administrators
Config Roles, settings, controlled fields Administrators

Use Excel Tables where possible. A table expands with new rows and makes column references more stable than hard-coded ranges.

🔑 Give Every Record a Stable Unique ID

Never identify a row only by its current row number. Sorting, filtering, inserting rows, and deleting records can all change row positions.

Instead, include a unique identifier such as CustomerID, EmployeeID, or a generated record key. The approval macro should find the target record by that ID when it applies a change.

A stable ID is the equivalent of an address: it lets the system locate the correct record even after the worksheet has been reorganized.

📋 Design an Audit Log That Answers Real Questions

An effective log must reconstruct the decision later. Record enough context that a reviewer does not need to guess what happened or search old email threads.

Useful columns include:

  • RequestID: a unique identifier for the change request
  • RecordID: the record being changed
  • FieldName: the controlled column or business field
  • OldValue and ProposedValue
  • RequestedBy and RequestedAt
  • Status: Pending, Approved, Rejected, Applied, or Failed
  • ApprovedBy, ApprovedAt, and DecisionComment

Do not overwrite a pending log row when a decision is made. Update its status and decision fields, preserving the original request details.

🏷️ Use Request IDs, Not Just Timestamps

A timestamp is helpful, but it is not a dependable unique key. Two actions can occur within the same second, and users may edit a workbook on machines with different clock settings.

Generate a request ID that combines a time component with a random or sequential component. The exact format matters less than uniqueness and traceability.

Function NewRequestID() As String
    Randomize
    NewRequestID = Format(Now, "yyyymmddhhnnss") & "-" & _
                   Format(Int(Rnd() * 9000) + 1000, "0000")
End Function

For a controlled environment, a sequential number stored in a protected configuration sheet can be easier to read. It must be updated carefully to avoid duplicates.

👤 Identify Users With Appropriate Caution

VBA can obtain the signed-in Windows user through environment information. This is convenient for an internal workbook, but it is not proof of identity in the same way as a centrally managed authentication system.

Function CurrentUserName() As String
    CurrentUserName = Environ$("Username")
End Function

Record this value in the log, but describe its limits honestly. A determined user with access to the workbook may be able to alter workbook content or run it in a different environment.

If accountability has legal, regulatory, or high-value financial consequences, use systems with centrally enforced identities and immutable audit capabilities rather than relying solely on an Excel macro.

🛂 Store Roles in a Configuration Table

Do not scatter approver names throughout VBA procedures. Put role assignments in a protected configuration table with columns such as UserName, Role, and Active.

Typical roles are Requester, Approver, and Administrator. A small function can look up the current user and return a role before allowing an action.

Function IsApprover(userName As String) As Boolean
    IsApprover = (Application.WorksheetFunction.CountIf( _
        Sheets("Config").Range("A:A"), userName) > 0)
End Function

In production code, search a defined table column rather than an entire worksheet column. Also check that the matching user is active and assigned the correct role.

🧾 Provide a Safe Request Entry Method

The simplest pattern is a dedicated request sheet with dropdowns for Record ID and Field Name, a cell for the proposed value, and a cell for justification. A button runs SubmitChangeRequest.

A UserForm can offer a more guided experience, especially when field-specific validation is needed. However, a worksheet form is easier for many teams to inspect, maintain, and adapt.

Whichever interface you choose, requesters should not type directly into controlled source cells. Lock those cells and make the request form the normal route for change.

✅ Validate Before Creating a Pending Request

Validation prevents weak requests from entering the queue. Check that the record exists, the selected field is approved for change, the proposed value is not blank when blank values are disallowed, and the requester has supplied a reason.

Validation should also be field-aware. A proposed credit limit should be numeric and within your organization’s accepted range; a proposed status should come from an approved list.

Do not rely on data validation alone. Users can paste values, macros can write values, and workbook structures can be altered. VBA should repeat important checks at submission time.

🧠 Capture the Old Value at Submission Time

The log must capture the value that was approved when the request was made. Retrieve it from the source record using the Record ID and Field Name, then write it to OldValue.

This becomes especially important if two users request changes to the same field. Without a recorded baseline, an approver may not notice that the record has changed since the request was submitted.

For complex values such as dates and amounts, store both a consistent raw value and an easily readable display value if your workflow needs precise reconstruction.

⏳ Keep Proposed Values Out of Official Records

A common design mistake is allowing a user to edit the official record first, then asking an approver to confirm it. That approach exposes other users to unapproved data and makes rejection difficult.

Instead, keep the proposed value in the log. The approved record remains unchanged until the authorization step succeeds.

This is the central control: a request is evidence of intent, not permission to modify the source data.

🔍 Build an Approver-Friendly Review Queue

Approvers should be able to filter the log to Pending rows and see the record ID, field, old value, proposed value, requester, timestamp, and reason without scrolling across a confusing sheet.

Add conditional formatting to make pending requests visible, but do not let colour be the only status signal. The text status should remain explicit for filtering, formulas, and accessibility.

For larger queues, use an approver review sheet that displays one selected pending request at a time. It can show the relevant source record alongside the proposed change.

⚖️ Make Approval a Deliberate Decision

An approval button should ask for confirmation and then update the selected request only. Avoid broad macros that approve every visible row unless that batch operation is explicitly designed, reviewed, and logged.

A simple decision routine should verify all of the following before applying a change:

  • The log row is still Pending.
  • The current user is an authorized approver.
  • The request contains a valid Record ID and controlled field.
  • The source record still exists.
  • The record’s current value has not changed unexpectedly.

Requiring an approval comment may be useful for exceptions, high-impact changes, or rejection decisions. It can be optional for routine approvals if mandatory comments would become meaningless boilerplate.

🔄 Detect Conflicts Before You Apply a Change

Imagine a request proposed changing a customer’s credit limit from 10,000 to 15,000. Before approval, another authorized process changes the value to 12,000. Applying the older request without review would silently overwrite the newer result.

Compare the current source value with the logged OldValue. If they differ, set the request to a status such as Conflict or Needs Review rather than automatically applying it.

This is a basic form of concurrency control: it detects that the underlying record changed while the request was waiting.

✍️ Apply the Change by Field Name, Not a Fixed Column Number

Hard-coding “column 8” works only until someone inserts a new column. A safer design locates a table column by its header name, such as PaymentTerms.

Set targetCell = recordRow.Range(1, _
    recordsTable.ListColumns(fieldName).Index)
targetCell.Value = proposedValue

Use error handling around the lookup. If an administrator renamed or removed a controlled field, the macro should stop and report the issue rather than write to an unintended column.

🚫 Treat Rejection as a Valuable Outcome

A rejected request is not an error in the system. It is evidence that review occurred and the proposed modification was not authorized.

When rejecting, retain the proposed value, the original value, the requester, the timestamp, and the decision comment. Set the status to Rejected; do not delete the row.

The requester can submit a fresh request if circumstances change. Reusing an old rejected row can blur the historical decision.

🛡️ Protect Sheets, Workbook Structure, and VBA Code

Worksheet protection can prevent casual direct edits to controlled cells. Lock the Records table, leave only the request form input cells unlocked, and protect the workbook structure so sheets are not easily deleted or moved.

VBA must be able to write to protected sheets. One approach is to protect the sheet in Workbook_Open with UserInterfaceOnly:=True, which lets macros edit locked cells while users cannot.

Private Sub Workbook_Open()
    Sheets("Records").Protect Password:="ChangeControl", _
        UserInterfaceOnly:=True
End Sub

This setting is not retained after the workbook closes, so it must be set again when the workbook opens. Password-protecting the VBA project adds a barrier, but it should not be treated as high-assurance security.

🔐 Understand the Limits of Excel Protection

Workbook and worksheet protection are useful safeguards against accidental changes and casual tampering. They are not equivalent to server-side access control, database permissions, or a tamper-proof audit ledger.

Anyone who can copy an unlocked workbook, disable macros, or edit its internal structures may be able to bypass parts of the workflow. Shared storage permissions still matter: restrict who can modify the file, and maintain suitable backup and version-history practices.

State these limitations clearly when presenting the tool. A well-designed workbook should reduce risk, not make unsupported promises about security.

🧰 Use Error Handling to Prevent Half-Finished Transactions

A macro may fail because a sheet is protected incorrectly, a record cannot be found, a user cancels an action, or a value has an unexpected type. Without error handling, a macro can update the record but fail before updating the log.

Structure the approval routine so it validates first, writes the source change, then updates the log status and decision fields. If an error occurs, display a clear message and record a failure status where practical.

On Error GoTo HandleError
'Validate request
'Write approved value
'Update log row to Applied
Exit Sub
HandleError:
    MsgBox "The change was not completed: " & Err.Description
End Sub

For higher reliability, avoid editing multiple unrelated areas until all validation has passed. Excel VBA does not offer database-style transactions by default.

🧹 Normalize Values Before Comparing Them

Excel can represent visually identical values in different ways. A date may be a serial number, a text string, or a formatted display; an amount may contain rounding differences; text may contain unwanted spaces.

Before comparing old and current values, define a field-specific normalization rule. For text, trimming leading and trailing spaces may be appropriate. For dates, compare normalized date values. For currency, use the precision your business process actually requires.

Do not blindly convert everything to text. That can hide meaningful distinctions and create misleading comparisons.

📌 Decide How to Handle Blanks and Deletions

Blank is not always the same as “no change.” In some fields, clearing a value is a legitimate request; in others, it should be prohibited.

Add an explicit option such as Clear existing value or document that an empty proposed value means removal. The approval log should record that intention unambiguously, perhaps with a display value such as [CLEARED] while preserving the underlying blank.

This prevents the common problem where a blank request is rejected as missing information even though the requester intended to remove outdated data.

📊 Add Statuses That Describe the Real Lifecycle

A two-status model of Pending and Approved is often too simple. Use statuses that distinguish decisions from successful application.

Status Meaning Next action
Pending Awaiting review Approve or reject
Conflict Source changed after request Review against current value
Approved Decision recorded; application may be pending Apply or investigate failure
Applied Source record updated successfully Retain as history
Rejected Change was not authorized Retain as history
Failed Technical issue interrupted processing Correct and review

Separating Approved from Applied is especially helpful if approvals and updates occur in different steps.

🧪 Test Normal, Bad, and Awkward Scenarios

Testing should go beyond a successful demo. Make a copy of the workbook and test with realistic but non-production records.

  • Submit a valid request and approve it.
  • Reject a request and confirm the source remains unchanged.
  • Request a change for a missing Record ID.
  • Try an invalid date, invalid number, and unauthorized field.
  • Change the source value while a request is pending.
  • Open the workbook with macros disabled and observe the user experience.
  • Sort the source table and confirm Record ID lookup still works.

Ask another person to test it using only the instructions. Confusion in their workflow often reveals missing validation or unclear sheet design.

📚 Document the Process, Not Only the Macros

A maintainable system includes a short guide explaining who can request changes, what fields are controlled, where pending requests appear, and what approvers should check before deciding.

Document the location of configuration settings and identify the workbook owner. Also include a procedure for restoring from backup, correcting a failed request, and updating approver roles when staff change.

Comments in VBA matter too. Explain business rules and assumptions, not merely obvious syntax.

🧩 Keep the Code Modular

Place reusable tasks in separate procedures: one function for locating a record, one for checking roles, one for writing a log entry, one for validation, and one for applying a change.

Modular code is easier to test because a problem in record lookup does not need to be debugged inside a long button-click event. It also reduces the temptation to copy and alter nearly identical code for every field.

A useful rule is that the approval button should coordinate the process, while helper procedures perform the detailed work.

📈 Know When VBA Has Reached Its Boundary

VBA is a good fit when the process is small, workbook-centered, and managed by people comfortable with Excel. It can be especially practical for internal request queues with a limited number of users.

Consider a database, SharePoint-based list, Power Automate workflow, or specialized change-management system when you need simultaneous editing at scale, strict identity controls, automated notifications, attachments, complex multi-level approval, or a tamper-resistant audit trail.

The right question is not whether VBA is powerful enough in isolation. It is whether Excel is an appropriate home for the business risk and collaboration level involved.

🌟 Build Trust Through Traceable Decisions

A useful change approval system does not merely block edits. It makes the path from request to decision understandable: a stable record is identified, the previous value is preserved, the proposed value is reviewed, and the authorized outcome is recorded.

Start small with one worksheet, a few controlled fields, and a clear approver role. Once the workflow is reliable, expand carefully rather than adding complexity before the core audit trail works.

The core principle is simple: separate proposing a change from applying a change, then preserve enough evidence to explain the decision later.

A VBA workflow cannot remove every risk from a shared workbook, but it can replace informal, invisible edits with a deliberate process people can review and improve. That is the real value of change control in Excel. ⚙️📝🔒