if you want it part of the code
For rownum = 1 To MaxRowNum
If UCase(Cells(rownum, 16)) Like "*NOT INDICATED*" Or UCase(Cells(rownum, 17)) Like "*NOT INDICATED*" Then
'Vlookup User Name from the file MISSINGUSERNAMEDEPT.xlsx
Range("P" & rownum).FormulaR1C1 = "= VLOOKUP(RC[-3],[MISSINGUSERNAMEDEPT.xlsx]Sheet1!C1:C5,2,0)"
'Vlookup Dept from the file MISSINGUSERNAMEDEPT.xlsx
Range("Q" & rownum).FormulaR1C1 = "= VLOOKUP(RC[-4],[MISSINGUSERNAMEDEPT.xlsx]Sheet1!C1:C5,3,0)"
Range(Cells(rownum, "P"), Cells(rownum, "Q")).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
End If
If UCase(Cells(rownum, 16).Value) = "#N/A" Then
Cells(rownum, 16).Value = "NOT INDICATED"
End If
If UCase(Cells(rownum, 17).Value) = "#N/A" Then
Cells(rownum, 17).Value = "NOT INDICATED"
End If
Next
add two more IF blocks
Bookmarks