Can someone explain why you put that in the beginning of Macros?
When I see Dim As "Integer" or Dim As "Long" How do I interpret the characteristics of these variables?
Can someone explain why you put that in the beginning of Macros?
When I see Dim As "Integer" or Dim As "Long" How do I interpret the characteristics of these variables?
swade730,
When you use Option Explicit, you are telling VBA that you want to define your variables.Option Explicit, Integers, Long
Can someone explain why you put that in the beginning of Macros?
This is a good programming practice.
This way, when there is a problem with the macro code, someone else will be able to better understand the code, and, find a the problem if one exists.
Integer numbers range in value from -32,768 to 32,767.
Long numbers range in value from -2,147,483,648 to 2,147,483,647.
When I program in VBA I always use LONG - this is a personal preference.
Here's a good primer on the scope of variables.
http://www.cpearson.com/excel/scope.aspx
Using Variables in Excel VBA Macro Code
http://www.ozgrid.com/VBA/variables.htm
For more good information:
On reply #38, there are a lot of links for information and training. Check it out.
http://www.excelforum.com/excel-prog...terials-4.html
Last edited by stanleydgromjr; 08-13-2013 at 07:37 PM.
Have a great day,
Stan
Windows 10, Excel 2007, on a PC.
If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks