Hello. I'm just doing some practicing with beginner macros. I input this code into the macro and it says variable not defined error. What is the issue? Thanks.
![]()
Please Login or Register to view this content.
Hello. I'm just doing some practicing with beginner macros. I input this code into the macro and it says variable not defined error. What is the issue? Thanks.
![]()
Please Login or Register to view this content.
Last edited by Leith Ross; 05-16-2013 at 07:50 PM. Reason: Added Code Tags
![]()
Please Login or Register to view this content.
Probably it's because you have "Option Explicit" at the top of the module page.
To get around it you can either disable or delete the "Option Explicit", or, better, explicitly declare the variable on the lines of
Dim Num as Single, or Dim Num as Double or just Dim Num (the first is best in your context)
I wouldn't recommend using Dim Num as Long unless you want to confine yourself to whole numbers.
To see why not, try Dim Num as Long and then enter 8.5 in your inputbox. Do you get the cube root of 8.5?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks