+ Reply to Thread
Results 1 to 3 of 3

Cell Referencing

  1. #1
    Registered User
    Join Date
    05-03-2007
    Posts
    1

    Cell Referencing

    Hi guys, this is my first post.

    I've got a range of data and need to find two values in column D and return the first common value in the columns A->C from the same row

    I want to be able to input the two values in A1 and A2 then have the macro automatically input the common value in A3.

    for example:
    a b c d
    3 z x y s
    4 z x t q
    5 z v y h
    6 z v t o

    If A1 and A2 equal "s" and "q" I want the macro to input "x" in A3
    Or if A1 and A2 equals "s" and "h" I want the macro to input "z" in A3

    I've use the 'find' function to code a macro that finds the two values from A1 and A2. I'm not sure how to define the cell references once found.
    Also I'm not sure how to return a value and input it in A3

    Many thanks.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    if you have a Range (like a cell) assigned to the variable myRange. Then

    myRange.Offset(i,j) refers to the cell i rows below and j columns from myRange.
    For example, if
    Please Login or Register  to view this content.
    As for putting values into cells, you can use either of these syntax (both do the same thing, put "x" in A3).
    Please Login or Register  to view this content.
    Cells is kind of like R1C1 notation. Cells(3,1) is Row 3, Column 1 a.k.a. A3.

  3. #3
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    With the test data in the range A6 : D9 try

    Please Login or Register  to view this content.

    HTH

    rylo

+ 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