rollingzep
Board Regular
- Joined
- Nov 18, 2013
- Messages
- 224
- Office Version
- 365
- Platform
- Windows
Hi,
I do a Match between two workbooks. It works fine.
The field in first WB looks at Col A or Col B and returns values from col C of the second WB.
I now need a third condition. If there are no matches, then it should be "NA".
How to do this?
I do a Match between two workbooks. It works fine.
The field in first WB looks at Col A or Col B and returns values from col C of the second WB.
I now need a third condition. If there are no matches, then it should be "NA".
How to do this?
VBA Code:
Data = .Value
With wbexcelEXT.Sheets("HQ").Cells(1).CurrentRegion
For i = 2 To UBound(Data)
Chk = Application.Match(Data(i, 33), .Columns(1), 0)
If IsError(Chk) Then
Chk = Application.Match("*" & Data(i, 33) & "*", .Columns(2), 0)
End If
If Not IsError(Chk) Then Data(i, 55) = .Cells(Chk, 3)
Next i
End With
.Value = Data
End With
ws.Range("BC:BC").NumberFormat = "@"