Hello All,
I am not sure what would be the best way to solve my challenge, looking for direction here. Thank you in advance for your assistance.
I am trying to accomplish the following:
Sheet 2 has reference data "static", column A has part numbers (alphanumeric) and column B has revision information (alphanumeric and a ".") this combination consists of about 30 rows.
Sheet 1 has "fluid" data, once again column A has part numbers (alphanumeric), which all can be found somewhere in Sheet2 column A. In column B this information may or may not be found in column B of sheet 2.
Sheet 1 consists of 700+ rows
I am trying to achieve the following:
if in Sheet 1 I match both a cell in column A and a cell in column B, then I know that me revision is up to date.
Example Sheet1:A1 and Sheet1:B1 matches Any Sheet2:A1-A30 and Sheet2:B1:B30 but it must match Ax and Bx of sheet 2, it can not match Ax and By of sheet 2 for example.
If in sheet 1 I match column A (which it will match one of the 30 columns in sheet 2) but there is no match in column B of sheet 2 I want to either turn that cell red in sheet 1 or in column C of sheet 1 add some text like, "Not up to latest revision"
I have the following that worked BUT to the best of my knowledge I would need to use ELSEIF for each of my 30 rows on sheet 2 and then modify the code for to operate on each of my 700+ rows on sheet 1, way too much work and too many line that I could make and error.
Sample of just matching column A and B from sheet 1 to column A and B to sheet 2:
Sub Test()
If Sheets("Sheet1").Range("A1") = Sheets("Sheet2").Range("A1") And Sheets("Sheet1").Range("B1") = Sheets("Sheet2").Range("B1") Then
Sheets("Sheet1").Range("C1") = "Up to latest revision"
ElseIf Sheets("Sheet1").Range("A2") = Sheets("Sheet2").Range("A2") And Sheets("Sheet1").Range("B2") = Sheets("Sheet2").Range("B2")
Sheets("Sheet1").Range("C1") = "Up to latest revision"
Else
Sheets("Sheet1").Range("C1") = "Not up to latest revision"
End If
End Sub
I know WHAT I need to DO, I just do not know how to do it efficiently.
Thank you for taking the time to get to read through to the end.
Kindest regards,
frank
Bookmarks