what type of variable is this?

R

Robert Crandal

I am currently writing code in my Worksheet_Change()
as follows:

Private Sub Worksheet_Change (ByVal Target as Range)
For Each t in Target
' Do stuff
Next
End Sub


If I decide to use "Option Explicit" in this module, I believe
that the compiler will ask me to declare the variable "t"
above. What type should I declare "t"?? Should it
be "Dim t as Range"??? or "Dim t as Variant"??? or
something else?


thank u
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top