+ Reply to Thread
Results 1 to 6 of 6

is there a function for getting the content of a cell?

  1. #1
    Registered User
    Join Date
    11-12-2005
    Posts
    3

    is there a function for getting the content of a cell?

    I have 2 variables which determine the row and the column of a cell. I need to find out the number in that cell.

    For example, if I have i=4 and j=2 then I need the number in B4. But I can't write "=B4" because i and j are variables therefore I need something like this "=cell_content(4;2)".

  2. #2
    Don Guillett
    Guest

    Re: is there a function for getting the content of a cell?

    in a macro

    i=4
    j=2
    cells(i,j)

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "tzvarza`" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have 2 variables which determine the row and the column of a cell. I
    > need to find out the number in that cell.
    >
    > For example, if I have i=4 and j=2 then I need the number in B4. But I
    > can't write "=B4" because i and j are variables therefore I need
    > something like this "=cell_content(4;2)".
    >
    >
    > --
    > tzvarza`
    > ------------------------------------------------------------------------
    > tzvarza`'s Profile:

    http://www.excelforum.com/member.php...o&userid=28765
    > View this thread: http://www.excelforum.com/showthread...hreadid=484522
    >




  3. #3
    Ron Rosenfeld
    Guest

    Re: is there a function for getting the content of a cell?

    On Sat, 12 Nov 2005 07:28:16 -0600, tzvarza`
    <[email protected]> wrote:

    >
    >I have 2 variables which determine the row and the column of a cell. I
    >need to find out the number in that cell.
    >
    >For example, if I have i=4 and j=2 then I need the number in B4. But I
    >can't write "=B4" because i and j are variables therefore I need
    >something like this "=cell_content(4;2)".



    =INDIRECT(ADDRESS(row_num,col_num))


    --ron

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996
    Will this work for you?:
    =OFFSET($A$1,I1-1,J1-1)

    Regards,
    Ron

  5. #5
    Registered User
    Join Date
    11-12-2005
    Posts
    3
    The function ADDRESS is what I tried to use, but didn't manage to get the actual number.

    Now I tested INDIRECT(ADDRESS(row_num,col_num)) and it works just fine :D

    10x for your help

  6. #6
    Ron Rosenfeld
    Guest

    Re: is there a function for getting the content of a cell?

    On Sat, 12 Nov 2005 07:55:25 -0600, tzvarza`
    <[email protected]> wrote:

    >
    >The function ADDRESS is what I tried to use, but didn't manage to get
    >the actual number.
    >
    >Now I tested INDIRECT(ADDRESS(row_num,col_num)) and it works just fine
    >:D
    >
    >10x for your help



    You're welcome. Thanks for the feedback.

    --ron

+ 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