VBA & Macro Problems

How to Send an Email or Text When an Excel Cell Changes Using VBA

John WilsonJohn Wilson Nov 11, 2026 869 views

Question details

The user needs to set up automated email or text message notifications triggered when specific cells in an Excel spreadsheet reach specific target values.

How to Send an Email or Text When an Excel Cell Changes Using VBA
Product
Excel 365
Device & OS
not provided
Scenario
Monitoring live data feeds in an Excel workbook to send instant alerts via email or SMS when specific threshold values are met.
Observed behavior
There is no built-in notification system for cell value changes, requiring a VBA macro solution to track cell updates and trigger alerts via Outlook or SMS gateways.
Before you start

Ensure you have the Outlook desktop application installed and configured with an active email account, and save your workbook as an Excel Macro-Enabled Workbook (.xlsm).

Solution 1Recommended

Automate Email Notifications via VBA Worksheet_Change Event

Use a Worksheet_Change event macro to monitor a specific range and automatically trigger an Outlook email when the target value is reached.

This method uses Excel's built-in event handlers to constantly monitor specific cells (e.g., A1:B10). When a user manually inputs a value that meets your criteria, it triggers a secondary script to send an email via the Outlook desktop application.

For SMS text notifications, you can substitute the standard email address with your recipient's carrier SMS gateway address (e.g., 1234567890@vtext.com for Verizon or 1234567890@txt.att.net for AT&T).

1
Open the VBA Editor

Press ALT + F11 on your keyboard to open the Visual Basic for Applications (VBA) Editor in Excel.

2
Add the Worksheet_Change Event

In the Project Explorer panel on the left, double-click the specific worksheet you want to monitor (e.g., Sheet1). Paste the Worksheet_Change VBA code here to monitor your target range and set the trigger condition (e.g., If cell.Value >= 100).

3
Create a Standard Module

Go to Insert > Module in the top menu to create a new standard module. This is where your notification script will reside.

4
Add the Outlook Automation Code

Paste the SendNotification sub procedure into the new module. Ensure the code uses CreateObject("Outlook.Application") to interface with your Outlook client.

5
Configure Recipient and Save

Update the '.To' field in the code with the recipient's email address or SMS gateway address. Close the VBA editor and save your file as an Excel Macro-Enabled Workbook (*.xlsm).

Automate Email Notifications via VBA Worksheet_Change Event
Formula and External Data Limitations: The Worksheet_Change event only triggers on manual data entry. If your target cells are updated via formulas or external live data connections, use the Worksheet_Calculate event instead.
Advanced Automation

Automate Cell Alerts with WPS Spreadsheet

WPS Office provides robust support for VBA macros, allowing you to easily set up automated email triggers and monitor cell changes just like in Microsoft Excel.

  1. 1. Open WPS Spreadsheet: Launch your workbook in WPS Spreadsheet and navigate to the 'Tools' tab on the top ribbon.
  2. 2. Access the VBA Editor: Click on 'Macros' and select 'VBA Editor' to open the development environment.
  3. 3. Insert the Event Code: Double-click your target worksheet in the Project Explorer and insert your Worksheet_Change event code.
  4. 4. Add the Notification Script: Create a new module from the 'Insert' menu and paste your Outlook automation script.
  5. 5. Save as Macro-Enabled: Go to File > Save As, and choose 'Excel Macro-Enabled Workbook (*.xlsm)' to keep your automated triggers active.
Fully compatible with Microsoft Excel (.xlsm) macro files and VBA syntaxIntuitive VBA Editor for custom automation scripts and alertsLightweight application with high performance for live data processingFree and comprehensive suite for all your daily spreadsheet needs
microsoft office alternative - wps office

Frequently Asked Questions

Why isn't my macro triggering when a formula changes the cell value?

The Worksheet_Change event is specifically designed to detect manual inputs or direct edits. To trigger a macro based on a formula recalculation or external data refresh, you must use the Worksheet_Calculate event.

How do I find the correct SMS gateway for text notifications?

You need to know the recipient's mobile carrier to use an email-to-SMS gateway. Common gateways include @vtext.com for Verizon, @txt.att.net for AT&T, and @tmomail.net for T-Mobile. Simply append the gateway domain to the recipient's 10-digit phone number.

Will this VBA macro run if Outlook is currently closed?

Yes, but Outlook must be fully configured on your computer. The VBA script uses CreateObject to launch an invisible Outlook instance in the background. However, having Outlook already open ensures faster execution and avoids potential profile login prompts.

How can I stop the macro from sending multiple emails for the same cell?

To prevent duplicate emails, you can add a helper column adjacent to your data or use a boolean flag within your VBA code to mark a cell as 'Notified'. Modify your IF statement to check this flag before sending an email.