When are apostrophes ignored as comment indicators in Excel VBA?
When they are contained within a set of quotation marks
(e.g. Msg = "Can't continue")
Quick way to convert a block of statements into comments
From the VBE:
Select group of statements and click the Comment Block button
The first character of a variable must be a _____.
Does VBA distinguish between uppercase and lowercase letters in variables?
Cannot use these characters in a variable name
#, $, %, &, !
Letting VBA handle your data typing results in these two issues
inefficient memory use
To get a slight performance increase use this instead of Integer for variable type
What is the default data type?
What is the data type Variant?
changes type depending on what you do with it
Use this statement as the first statement in code to force declaration of all variables
One benefit of using Option Explicit as first line
mis-spelled variables will be identified as not being typed
Press this after typing the first two or three characters of a variable or reserved word or function to get selection list or auto-completion
Example of dimensioning a variable
Dim YourName as String
Dim January_Inventory as Double
Dim RowNumber as Long
(X is treated as a Variant)