Fix VBA Method or Data Member Not Found in After Update Event
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.

- 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.
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.
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.
Press ALT + F11 to open the Visual Basic for Applications editor in your spreadsheet.
In the Project Explorer pane on the left, double-click your UserForm to open it in the visual designer.
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.
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.

Check for Missing Library References
Missing Object Library references can cause standard VBA methods to become unrecognizable, leading to compilation errors.
Isolate the Issue with a Sample Workbook
If the error persists and the code appears correct, the form or the workbook itself might be corrupted or containing conflicting macros.
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. Open WPS Spreadsheets: Launch WPS Office and open your macro-enabled workbook.
- 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. Open the VBA Editor: Click on 'VBA Editor' to inspect your After Update events, edit form controls, and fix object reference errors directly.

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.




