VBA & Macro Problems

Fix VBA Method or Data Member Not Found in After Update Event

Algirdas JasaitisAlgirdas Jasaitis Nov 10, 2026 872 views

Question details

The user needs to fix a VBA error that prevents an email field from automatically populating after a representative's name is entered in a form.

Fix VBA After Update Error When Filling an Email Field
Product
Excel
Device & OS
not provided
Scenario
Using an After Update event in a VBA form (UserForm) to automatically fill a CSR email address field based on another input field.
Observed behavior
Triggering the After Update event produces a 'Method or data member not found' compile error.
Before you start

Ensure you have access to the Developer tab and the VBA Editor (ALT + F11) so you can inspect your UserForm controls, their exact property names, and the underlying event code.

Solution 1Recommended

Verify Control Names and Object References

The 'Method or data member not found' error most commonly occurs when VBA attempts to reference a control name, property, or method that does not exist or has been misspelled.

When coding an After Update event, referencing a form control (like a TextBox) using the 'Me' keyword (e.g., Me.txtEmail) requires the control's name in the Properties window to match your VBA code exactly.

1
Open the VBA Editor

Press ALT + F11 to open the Visual Basic for Applications editor in your spreadsheet.

2
Locate the UserForm

In the Project Explorer pane on the left, double-click your UserForm to open it in the visual designer.

3
Check the Email Field Name

Click on the CSR email field control on the form. Look at the Properties window (press F4 if it's hidden) and locate the '(Name)' property. Take note of the exact spelling.

4
Update the VBA Code

Right-click the form and select 'View Code'. Find your After Update event procedure and ensure any references to the email field exactly match the name you just verified.

Verify Control Names and Object References
Use IntelliSense: When typing 'Me.' in the VBA editor, a dropdown list should appear. If your control name does not appear in this list, it hasn't been named correctly on the form.
Advanced Spreadsheet Management

Manage VBA and Macros Easily with WPS Office

WPS Spreadsheets provides powerful support for macros and VBA, allowing you to automate tasks and build robust UserForms efficiently. It serves as a highly compatible and lightweight alternative for your daily data processing needs.

  1. 1. Open WPS Spreadsheets: Launch WPS Office and open your macro-enabled workbook.
  2. 2. Access the Developer Tools: Navigate to the Developer tab on the top ribbon. If it is hidden, you can enable it in the Options menu.
  3. 3. Open the VBA Editor: Click on 'VBA Editor' to inspect your After Update events, edit form controls, and fix object reference errors directly.
Full compatibility with Microsoft Excel macro-enabled formats (.xlsm, .xls)Built-in VBA editor for seamless code troubleshooting and form designLightweight installation with fast execution of complex macro scriptsFamiliar interface that requires zero learning curve to migrate
microsoft office alternative - wps office

Frequently Asked Questions

What triggers the After Update event in an Excel UserForm?

The After Update event is triggered automatically when a user changes the data within a control (such as typing a name into a TextBox) and then moves the focus to another control by pressing Tab, Enter, or clicking elsewhere.

Why does my VBA code say 'Method or data member not found' for a default property?

This usually happens when you misspell the control name in your code, or if you accidentally deleted the control from the UserForm. Double-check the exact (Name) property of your email field in the Properties window.

Can I use VLookup inside VBA to populate the email field?

Yes, you can use Application.WorksheetFunction.VLookup within your After Update event. You can take the representative's name from the first field, look it up in a designated spreadsheet range, and assign the returned email string to the email TextBox's Value property.