somewhat minute technical question about selecting each cell in a range

  • Thread starter Thread starter akh2103
  • Start date Start date
A

akh2103

Hello--I am a VB newbie and I have noticed that the most common way
that one cycles thru a each cell in a range to perform an action is by
for/each code that goes something like...

Sub MultiplyInRange()
For Each n in Selection
n.Value = n.Value * 3
Next
End Sub()

I am wondering, what sort of object is our "n" in this example--i.e.
what sorts of objects are the class-members in a range? I ask both
because I want to understand what is going on and because I am trying
to declare all variable types to save memory when the program is
running.
 
akh2103,

I don't know if this will answer your questions, but if you declare "n" below in your example as a Range variable, it should work
just fine.

I hope this helps,

Conan
 

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

Back
Top