When I declare a set of variables in Microsoft Excel's VBA Version 15.0 as such:
Option Explicit
Sub MyCode()
Dim i, j, k As Integer
.
'/Code Goes Here
.
End Sub
...I notice in my Locals Window that i & j (or any variables except the last variable declared as any datatype) are variants; however, k is declared as type: Integer.
When I step through my code, I see i & j change from: Variant/Empty to Variant/Integer as I assign integers to i & j. Since they're variants, I can also assign other datatypes to i & j.
QUESTION: Is there any way to declare multiple variables per line of the same datatype without a long-winded: Dim i As Integer, j As Integer, k As Integer?
I thought Dim i, j, k As Integer declared all i, j, and k as Integers and now I'm about 10,000 lines deep into a project I'd rather not retrace through for that. Hoping for some kind of Application.Magic command.
Thanks in advance,
Joe
Bookmarks