Thread: vba outcome
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default vba outcome

can anyone tell me if theres any errors in this...

sub test ()

dim I, J As Integer


The above statement only declares the variable J as an Integer; the variable
I will be declared as a Variant. In VBA, you must declare each variable's
type individually. So, you could write the above this way...

Dim I As Integer, J As Integer

or this way (your choice)....

Dim I As Integer
Dim J As Integer

My personal preference is for the latter, but that is only a personal
preference.

Rick