'Variable Not Defined' error... even though it is(?) Same code worked yesterday... now no control types (or other) are working ????

kbishop94

Active Member
Joined
Dec 5, 2016
Messages
476
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Yesterday, everything worked fine. Today, now I get the same error on every control I select.

I also tried a completely separate workbook (nothing in common with the first except both use VBA) and got the same error! :confused:

The only change I made yesterday to bothwork books was adding in some protection stuff, but all was working fine, and now... not.

I went back to a version from the previous day from that (so 2 days ago) and it works fine. Examined the code from both... and aside from the changes yesterday, both are the same.

So... I copied all the code over to a Word document that I have a macro set up so I can make quick changes to certain words/lines of code (been using it for months now and its not done anything that didnt copy over to excel just perfectly) and I removed all the protection stuff code from yesterday (entered a " ' " at the begininng of each line).. and... no improvement. Same 'Variable Not Defined' error... huh?

Anyone seen or heard of this before... (ms.google was of absolutely no help to me lol)
Here is the error, and some of the code, and you can see my " ' " that was inserted at the beginning of all code that I had added yesterday.

15z1b9e.jpg
 
wow... you nailed it. Cant believe I didn't realize that (well... actually I can believe it because I DIDN'T KNOW THAT as I am still a complete novice here. lol)

When comparing the 2 VBA projects side by side I didnt even notice that difference between the 2. :banghead:

Thank you, Fluff :oops:
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
ALso, I believe I know what happened too... I found a bit of code for protecting the workbook (as well as not allowing doubleclick change event and a few others) and when I copied and pasted it to my code, one of them included the "option explicit". Going back through the previous "save as's" I have (usually mutilple times a day w/ different names) no others included the "option explicit". So chalk this one up as a learning event for me. :bow:
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top