+ Reply to Thread
Results 1 to 2 of 2

somewhat minute technical question about selecting each cell in a range

  1. #1
    akh2103@gmail.com
    Guest

    somewhat minute technical question about selecting each cell in a range

    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.


  2. #2
    Conan Kelly
    Guest

    Re: somewhat minute technical question about selecting each cell in a range

    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


    <akh2103@gmail.com> wrote in message news:1155052929.614306.27500@i3g2000cwc.googlegroups.com...
    > 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.
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1