So I started using vba for a university project and the lecturer’s codes are able to run during class without any variable declaration. On my computer it throws a runtime error if I never declare variables. I read online that you can configure excel using tools > options > editor and uncheck the explicit variable declaration option. However for excel 2019 the UI has changed and I cannot find the options window. Online guides are not updated to the newer versions. I was wondering if anyone knows how I can set implicit variable declaration in excel 2019?
1 Answer
The name was changed - you're looking for Require Variable Declaration
. That's still in Tools -> Options in the VBA editor in Excel 2019.
If you're having trouble reaching it, right click on the ribbon, hit "Customize the ribbon", and check "Developer" on the right-hand pane. Then hit Visual Basic, and this should bring up the editor you're familiar with. Here's a screen recording