+ Reply to Thread
Results 1 to 2 of 2

Compare values with 2 columns and return from the third

Hybrid View

  1. #1
    Registered User
    Join Date
    08-12-2010
    Location
    Kuwait
    MS-Off Ver
    Excel 2007
    Posts
    2

    Compare values with 2 columns and return from the third

    I want to compare values in an array. THe program must match value from one cell in another file to the first column in the array, if it matches, then compare another cell from the same first file with the 2nd column in the array in the same row. I f these values match then it should return value from another column in the same row.

    I am attaching the file for reference, The first column to be matched is 'B' on 2nd page, the second column is column 'D' an the returning value column is column H

    It will be better if you explain main points in code like which command is for what purpose because I might need to amend the program for according to other requirements I have.

    So, can anyone please help?
    Attached Files Attached Files
    Last edited by fms_me; 08-14-2010 at 02:40 AM.

  2. #2
    Registered User
    Join Date
    08-12-2010
    Location
    Kuwait
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Compare values with 2 columns and return from the third

    I am trying with this program Can Anyone help me take out errors from my Program?



    Sub Macro1()
    '
    ' Macro1 Macro
    '

    Dim i As Integer
    Dim j As Integer
    For i = 95 To 168
    If (R[-30]C[-1]='[CATALOG DATA PNG-048 TO 120.xlsx]Sheet1'!$B$i) & (R[-24]C[0]='[CATALOG DATA PNG-048 TO 120.xlsx]Sheet1'!$D$i) Then
    ActiveCell.FormulaR1C1 = Sheets("Sheet1").Cells(i, 8).Value
    Next i

    '
    End Sub

+ 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