The macro at the bottom of this message performs a lookup based on the value in column N. It correctly populates columns P and Q with an ID and person's name.
If data does not exist in column N, then the macro is returning #N/A
Is there anyway to modify this macro so that if data is not present in column N, then P and Q are also blank opposed to the #N/A ?
Sub populatePOCsNameID()
'
'
'
Sheets("Summary").Select
Range("P4").Select
ActiveCell.FormulaR1C1 = _
"=LOOKUP(RC[-1],'Lookup Tables'!R1C1:R27C1,'Lookup Tables'!R1C2:R27C2)"
Range("Q4").Select
ActiveCell.FormulaR1C1 = _
"=LOOKUP(RC[-2],'Lookup Tables'!R1C1:R27C1,'Lookup Tables'!R1C3:R27C3)"
Range("P4:Q4").Select
Selection.AutoFill Destination:=Range("P4:Q30"), Type:=xlFillDefault
Range("P4:Q30").Select
Range("R3").Select
End Sub
If data does not exist in column N, then the macro is returning #N/A
Is there anyway to modify this macro so that if data is not present in column N, then P and Q are also blank opposed to the #N/A ?
Sub populatePOCsNameID()
'
'
'
Sheets("Summary").Select
Range("P4").Select
ActiveCell.FormulaR1C1 = _
"=LOOKUP(RC[-1],'Lookup Tables'!R1C1:R27C1,'Lookup Tables'!R1C2:R27C2)"
Range("Q4").Select
ActiveCell.FormulaR1C1 = _
"=LOOKUP(RC[-2],'Lookup Tables'!R1C1:R27C1,'Lookup Tables'!R1C3:R27C3)"
Range("P4:Q4").Select
Selection.AutoFill Destination:=Range("P4:Q30"), Type:=xlFillDefault
Range("P4:Q30").Select
Range("R3").Select
End Sub
Last edited: