Help with code compile error message.
Hi all,
I am very new to programming and VBA so absolutely any help is greatly appreciated. I am trying to fix this code and I cannot find where the error is. Whenever I try to run it, I get a message saying "Compile error: Variable not defined"
Option Explicit
Sub ChipmunkToss()
Dim Dale As Single, Theo as Single
Dale = 11.1
Theo = 31.3
MsgBox Dale1 + Theo1
End Sub
Thank you in advance for any help!
Re: Help with code compile error message.
Single means WHOLE # ONLY. No decimal points. Try 11 + 31 instead
Re: Help with code compile error message.
Quote:
Originally Posted by
dglienna
Single means WHOLE # ONLY. No decimal points. Try 11 + 31 instead
What?
Single means Single Precision and has decimals
The problem here is that @AndrewDz is declaring Dale and Theo but he is using Dale1 and Theo1 in the MsgBox
Re: Help with code compile error message.
oops. was thinking INT for Integer
Re: Help with code compile error message.
Your problem is highlighted in Red
Code:
Option Explicit
Sub ChipmunkToss()
Dim Dale As Single, Theo as Single
Dale = 11.1
Theo = 31.3
MsgBox Dale1 + Theo1
End Sub
Dale1 and Theo1 do not exist
Edit: I see that jggtz pointed this out above also