Hi All
I need to match column T (20) value and see if it exists in column N where the column A value and the Column I values are equal. if it finds it, it needs to write the value: "502"
in column 7 where it found it
For example for row 7 and 8, column A and column I matches, so it needs to check the value in column T which is 8 in row 8. Column N in row 8 doesn't have the value but row 7 has.
The value for Row 7, column G needs to populate the value 502 because it found a matching value
The same for Row 11, 12 and 13 as their column A and column I matches, so it needs to check the value in column T which is 5 in row 13. Column N in row 13 doesn't have the value but row 12 has.
I have the following code (There is other code as well but I think this is the problem piece):
I need to match column T (20) value and see if it exists in column N where the column A value and the Column I values are equal. if it finds it, it needs to write the value: "502"
in column 7 where it found it
For example for row 7 and 8, column A and column I matches, so it needs to check the value in column T which is 8 in row 8. Column N in row 8 doesn't have the value but row 7 has.
The value for Row 7, column G needs to populate the value 502 because it found a matching value
The same for Row 11, 12 and 13 as their column A and column I matches, so it needs to check the value in column T which is 5 in row 13. Column N in row 13 doesn't have the value but row 12 has.
I have the following code (There is other code as well but I think this is the problem piece):
VBA Code:
If .Cells(counter, 1).Value = .Cells(counter + 1, 1).Value And .Cells(counter, 9).Value = .Cells(counter + 1, 9).Value Then
'.Cells(counter, 20).Value > 0 And
Dim FoundCell As Range
Dim ws As Worksheet
Set ws = Sheets("Mini")
Dim WHAT_TO_FIND As Integer
WHAT_TO_FIND = .Cells(counter, 20).Value
Set FoundCell = ws.Range("N:N").Find(What:=WHAT_TO_FIND)
If Not FoundCell Is Nothing Then
.Cells(counter, 7).Value = "502"
MsgBox ("Found")
Else
.Cells(counter, 7).Value = "501"
MsgBox ("Not Found")
End If
End If