There are currently 1 users browsing this thread.
Variable not Defined Error
Forum Rules. Register Help Forgotten Your Password?
Why it is important to define variables with Dim in Excel VBA
Remember Me? Variable not Defined Error. Register To Reply.
Re: Variable not Defined Error. Avoid using Select, Selection and Activate in your code.
Re: Variable not Defined Error
Use With End With instead. Re: Variable not Defined Error Immediate problem is solved But perhaps you should learn what declaring a variable means, the advantages of declaring all variables before use and the pitfalls of relying on VBA to create variables on the fly.
One day, you're going to do something like this Last edited by cytop; at PM.
Re: Variable not Defined Error cytop Don't watch football while you're coding so things like that don't happen. Re: Variable not Defined Error There are still few people who doesn't understand the importance of declaring variable Re: Variable not Defined Error There are still a few people who don't understand And aren't people entitled to have their own opinion about declaring variables?
It's not that code won't run if you don't declare variables. It's just an endless discussion. Last edited by bakerman2; at PM.
Re: Variable not Defined Error Hello, cytop i don't know what i say here? Re: Variable not Defined Error HaroonSid The biggest worry is that some one like you ask questions and get the codes here and elsewhere and use them frequently. If some one gives you a code with a Global variable and if it is accidentally the same variable name used elsewhere for other reason, your whole project might get destroyed.
Even if the same variable used in other procedure and if declared within a procedure level, you will have no problem at all.
So I strongly recommend to declare variables at procedure level. Bookmarks Bookmarks Digg del.
All times are GMT The time now is AM.