Forum Discussion
seolac
Sep 26, 2019Copper Contributor
Run-time error 9 after copying a macro to a new project in VBA
I have a very simple macro as below to run a UserForm (formHygiene) in VBA. It works fine in one file. I wanted to use it for other Excel file and copied the macro and the UserForm to other (b...
Haytham Amairah
Sep 27, 2019Silver Contributor
Hi,
I've tried to reproduce that, but I didn't see any error!
If the new workbook has a different structure, so it's possible that the code in the UserForm refers to something missing.
Please watch this https://www.youtube.com/watch?v=AC3GgPOalLM to learn more about the Run-time error 9 and its common reasons.
Hope that helps