D
dingo.xrull
Can anyone tell me how to wrap this formula in VBA code so it runs as
a value?
I'm trying to understand how to nest this formula by using VBA codes.
I can do a basic Vlookup, but when it comes to dealing with the
errors, it is a struggle
=IF(ISERROR(VLOOKUP(IF(C3="",VLOOKUP(D3,Org!B:O,F3+2,0),IF
(D3="",VLOOKUP(C3,Org!B:O,F3+2,0))),$O$3:$O
$114,1,0)),H3&"C0MISCELLANEOUS",H3&(VLOOKUP(IF(C3="",VLOOKUP(D3,Org!
B:O,F3+2,0),IF(D3="",VLOOKUP(C3,Org!B:O,F3+2,0))),$O$3:$O$114,1,0)))
I tried using this method
Sub Run_Alex()
With Sheets("Alex_1")
iLastRow = .Cells(.Rows.Count, "F").End(xlUp).Row
For i = 3 To iLastRow 'iLastRow to 1 Step -1
.Cells(i, "K").Value = Evaluate("=IF(ISERROR(VLOOKUP(IF(C"
& i & "="""",VLOOKUP(D" & i & ",Data1!B:O,F3+2,0),IF(D" & _
i & "="""",VLOOKUP(C" & i & ",Data1!B:O,F3+2,0))),$O$3:$O
$114,1,0)),H" & i & "& ""C0MISCELLANEOUS"",H" & i & "& _(VLOOKUP(IF(C"
& "="""",VLOOKUP(D" & i & ",Data1!B:O,F3+2,0),IF(D" & "="""",VLOOKUP
(C" & i & ",Data1!B:O,F3+2,0))),$O$3:$O$114,1,0)))")
Next i
End With
End Sub
But it keeps returning #Value.
If it is not too much trouble, could you step me through the logic?
It is giving me sleepless nights.
Thanks,
Xrull
a value?
I'm trying to understand how to nest this formula by using VBA codes.
I can do a basic Vlookup, but when it comes to dealing with the
errors, it is a struggle
=IF(ISERROR(VLOOKUP(IF(C3="",VLOOKUP(D3,Org!B:O,F3+2,0),IF
(D3="",VLOOKUP(C3,Org!B:O,F3+2,0))),$O$3:$O
$114,1,0)),H3&"C0MISCELLANEOUS",H3&(VLOOKUP(IF(C3="",VLOOKUP(D3,Org!
B:O,F3+2,0),IF(D3="",VLOOKUP(C3,Org!B:O,F3+2,0))),$O$3:$O$114,1,0)))
I tried using this method
Sub Run_Alex()
With Sheets("Alex_1")
iLastRow = .Cells(.Rows.Count, "F").End(xlUp).Row
For i = 3 To iLastRow 'iLastRow to 1 Step -1
.Cells(i, "K").Value = Evaluate("=IF(ISERROR(VLOOKUP(IF(C"
& i & "="""",VLOOKUP(D" & i & ",Data1!B:O,F3+2,0),IF(D" & _
i & "="""",VLOOKUP(C" & i & ",Data1!B:O,F3+2,0))),$O$3:$O
$114,1,0)),H" & i & "& ""C0MISCELLANEOUS"",H" & i & "& _(VLOOKUP(IF(C"
& "="""",VLOOKUP(D" & i & ",Data1!B:O,F3+2,0),IF(D" & "="""",VLOOKUP
(C" & i & ",Data1!B:O,F3+2,0))),$O$3:$O$114,1,0)))")
Next i
End With
End Sub
But it keeps returning #Value.
If it is not too much trouble, could you step me through the logic?
It is giving me sleepless nights.
Thanks,
Xrull