+ Reply to Thread
Results 1 to 5 of 5

How can I use a cell value to reference a row?

  1. #1
    excelchallenged
    Guest

    How can I use a cell value to reference a row?

    a5 is an integer variable from 15 to 925 in increments of 1. When a5 is 20
    cell a10 (or any cell I chose) should read the contents of j20. When a5 is
    825 cell a10 should read the contents of j825. The integer value in a5
    defines the row of column j returned in cell a10.

  2. #2
    Jim Thomlinson
    Guest

    RE: How can I use a cell value to reference a row?

    Take a look at the indirect function in Excel It will allow you to set your
    reference dynamically. Something like this

    =INDIRECT("Sheet1!J" & A5)
    --
    HTH...

    Jim Thomlinson


    "excelchallenged" wrote:

    > a5 is an integer variable from 15 to 925 in increments of 1. When a5 is 20
    > cell a10 (or any cell I chose) should read the contents of j20. When a5 is
    > 825 cell a10 should read the contents of j825. The integer value in a5
    > defines the row of column j returned in cell a10.


  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Excelchallenged,

    In cell A10 place the formula...
    =INDIRECT("J" & A5)

    Sincerely,
    Leith Ross

  4. #4
    Forum Contributor
    Join Date
    01-10-2006
    Location
    Ahmedabad, India
    MS-Off Ver
    Office 2000
    Posts
    346
    Quote Originally Posted by excelchallenged
    a5 is an integer variable from 15 to 925 in increments of 1. When a5 is 20
    cell a10 (or any cell I chose) should read the contents of j20. When a5 is
    825 cell a10 should read the contents of j825. The integer value in a5
    defines the row of column j returned in cell a10.
    why not
    temp=[A5]
    cells(10,"A").value=cells(temp,"j").value

    A V Veerkar

  5. #5
    Jim Thomlinson
    Guest

    Re: How can I use a cell value to reference a row?

    While indirect is a volitile function meaning that it will recalcualte every
    thime the sheet calculates it will (in all likelyhood) still be more
    efficient than using the on change event handler that you are proposing.
    Built in functions are almost always more efficient than code. If you want to
    try it though be my guest. It will work...
    --
    HTH...

    Jim Thomlinson


    "avveerkar" wrote:

    >
    > excelchallenged Wrote:
    > > a5 is an integer variable from 15 to 925 in increments of 1. When a5 is
    > > 20
    > > cell a10 (or any cell I chose) should read the contents of j20. When a5
    > > is
    > > 825 cell a10 should read the contents of j825. The integer value in a5
    > > defines the row of column j returned in cell a10.

    >
    > why not
    > temp=[A5]
    > cells(10,"A").value=cells(temp,"j").value
    >
    > A V Veerkar
    >
    >
    > --
    > avveerkar
    > ------------------------------------------------------------------------
    > avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
    > View this thread: http://www.excelforum.com/showthread...hreadid=509173
    >
    >


+ 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