+ Reply to Thread
Results 1 to 8 of 8

How to determine Row and Column of cell

  1. #1
    Registered User
    Join Date
    04-27-2013
    Location
    Bradenton,florida
    MS-Off Ver
    Excel 2007
    Posts
    40

    How to determine Row and Column of cell

    I am writing a simple function, and would like to know the row and column of the cell that initiated the function.

    In a simple spreadsheet in Row 2 Col C I have =TestFunction()

    In TestFunction how could I determine Row 2 Col C
    Thank you very much
    JoeBBB

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: How to determine Row and Column of cell

    How about
    Please Login or Register  to view this content.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to determine Row and Column of cell

    C
    D
    2
    R2C3 C2: =testfunction()


    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    04-27-2013
    Location
    Bradenton,florida
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: How to determine Row and Column of cell

    Thank you very much for your response. I tried it and placed the function in Row 5 Column 9 of the main sheet. In the function itself I set a variable
    RowTest = application.call … The value in RowTest was "R5C9"
    What I need to do is modify the row and column number to fetch a value. For example I might want to fetch from row 10 and Column 14 - modify provided row and column by 5 to get value. How do I isolate the Row and column number.
    Again Thank you very much
    JoeBBB

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: How to determine Row and Column of cell

    Your title: determine Row and Column of cell, indicates you want the address of the cell with the function; however, you say in #4: "...get a value ..." (relative to the cell with the function)

    Please Login or Register  to view this content.
    use:
    =TestFunction(5)
    Last edited by protonLeah; 06-03-2019 at 08:37 PM.
    Ben Van Johnson

  6. #6
    Registered User
    Join Date
    04-27-2013
    Location
    Bradenton,florida
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: How to determine Row and Column of cell

    Most important - thank you very much for helping me. I am going to try to explain what I want more clearly I hope.

    I want to create a function which will take the row and column of where initiated modify those values and fetch the contents of different location
    Assume in Row - 3 Column C is the statement =FetchValue(AParameter)

    Function FetchValue (Param)

    TheRow= need to know how to determine the row of where function initiated result should Be 3
    TheCol= how do I determine the column result should be either C or 3
    '
    'Modify TheRow and TheCol
    TheRow=TheRow+20 add on a value determined elsewhere
    '
    'Similarly for TheCol
    TheCol=TheCol+43

    'lastly fetch value and exit function
    FetchValue=Worksheets("SomeSheet").cells(TheRow,TheCol)
    End Function


    Again THANK YOU
    Thank you
    JoeBBB

  7. #7
    Spammer
    Join Date
    06-05-2019
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2

    Re: How to determine Row and Column of cell

    thank you for you suggestions

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: How to determine Row and Column of cell

    You can use something like
    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 6
    Last Post: 12-03-2015, 03:57 PM
  2. Replies: 0
    Last Post: 09-13-2015, 01:08 PM
  3. Replies: 0
    Last Post: 04-11-2012, 11:49 AM
  4. Determine highest cell value in column
    By agni452 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2012, 06:49 AM
  5. Find Last Filled Cell, Negate it, determine another cell and subtotal a column
    By kerl in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-30-2007, 06:50 PM
  6. [SOLVED] How to determine the column letter from Cell address
    By Jean in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-23-2006, 10:05 PM
  7. determine the column where a cell was found
    By usadream in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2006, 09:55 AM

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