Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Posts
    178

    Unanswered: Variable cell refernces

    Hey guys,

    Is it possible to have a variable cell references? for example in a loop

    where i = 2 TO 50

    then have a cell reference as B(i)

    is this possible?

    Thanks

    aboo

  2. #2
    Join Date
    Oct 2003
    Posts
    1,091
    Howdy, and welcome to the board.

    Yes that is possible, but you may want to include two variables (row and col). There are a couple of ways to do it, but the easiest way is to use Cells. In the following, it is not exactly correct, but you get the idea. If you want the double refernce (Row and Col), then use another For lngCol 2 to 50 statement inside the one below.

    Code:
    Dim lngRow as Long, lngCol as Long
    For lngRow 2 to 50
       Cells(lngRow,lngCol)
    Next lngRow
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  3. #3
    Join Date
    May 2006
    Posts
    178
    Thankyou for your welcome and for your reply. Im going to be buggin you alot.


Posting Permissions

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