Question: vba when to use dim?
Answer: Use the Dim statement at the module or procedure level to declare the data type of a variable. For example, the following statement declares a variable as an Integer. Also use a Dim statement to declare the object type of a variable. The following declares a variable for a new instance of a worksheet.