JonesZoid
New Member
- Joined
- Dec 11, 2013
- Messages
- 27
Hi All
I currently have a piece of code that matches 1 criteria and updates my tracker.
I would like now to introduce a second criteria to the match statement.
My current code is:
I have tried the following as the second criteria is a fixed value on this occasion.
It does retrieve the information, but it doesn't put it in the right row that matches i.
I have searched forums, and could only find, fixed value examples.
Thanks In Advance.
I currently have a piece of code that matches 1 criteria and updates my tracker.
I would like now to introduce a second criteria to the match statement.
My current code is:
Code:
Sub UpdateTracker()
Dim Mast As Worksheet
Dim HOP As Worksheet
Set Mast = ThisWorkbook.Worksheets(4)
Set HOP = ThisWorkbook.Worksheets(1)
Application.ScreenUpdating = False
For x = 2 To 30
If Mast.Range("D" & x) = "" Then
Exit Sub
Else
i = Mast.Range("D" & x).Value
m = Application.Match(i, Worksheets("Tracker").Range("B:B"), 0)
If IsError(m) = True Then
MsgBox "The ID " & m & " Is Not Found"
Exit Sub
End If
End If
I have tried the following as the second criteria is a fixed value on this occasion.
Code:
Sub UpdateTracker()
Dim Mast As Worksheet
Dim HOP As Worksheet
Set Mast = ThisWorkbook.Worksheets(4)
Set HOP = ThisWorkbook.Worksheets(1)
Application.ScreenUpdating = False
For x = 2 To 30
If Mast.Range("D" & x) = "" Then
Exit Sub
Else
i = Mast.Range("D" & x).Value
j = "Comm"
m = Application.Match(i, Worksheets("Tracker").Range("B:B"), 0) + Application.Match(j, Worksheets("Tracker").Range("K:K"), 0)
If IsError(m) = True Then
MsgBox "The ID " & m & " Is Not Found"
Exit Sub
End If
End If
It does retrieve the information, but it doesn't put it in the right row that matches i.
I have searched forums, and could only find, fixed value examples.
Thanks In Advance.