Hello,
I've got a script that imports some cost codes from a central list on the network. if there are no matching costcodes in this list it returns a n/a I need to remove this from happening. I've been trying the ISNA functions but can't seem to get it working. Can you have a look and point out whats wrong? VB script editor keeps saying debug problem eexception missing....
The original:
[C5].Formula = "=VLOOKUP(RC[-2],'\\networkpath\[Costcode Table.xls]Costcodes'!R8C2:R500C3,2,FALSE)"
If IsEmpty(ActiveCell) Then Exit Sub
With the ISNA()
[C5].Activate
[C5].Formula = "=IF(ISNA(VLOOKUP(RC[-2],'\\networkpath\[Costcode Table.xls]Costcodes'!R8C2:R500C3,2,FALSE)),"not allowed",VLOOKUP(RC[-2],'\\networkpath\[Costcode Table.xls]Costcodes'!R8C2:R500C3,2,FALSE))"
If IsEmpty(ActiveCell) Then Exit Sub
Thanks in Advance
Dave
I've got a script that imports some cost codes from a central list on the network. if there are no matching costcodes in this list it returns a n/a I need to remove this from happening. I've been trying the ISNA functions but can't seem to get it working. Can you have a look and point out whats wrong? VB script editor keeps saying debug problem eexception missing....
The original:
[C5].Formula = "=VLOOKUP(RC[-2],'\\networkpath\[Costcode Table.xls]Costcodes'!R8C2:R500C3,2,FALSE)"
If IsEmpty(ActiveCell) Then Exit Sub
With the ISNA()
[C5].Activate
[C5].Formula = "=IF(ISNA(VLOOKUP(RC[-2],'\\networkpath\[Costcode Table.xls]Costcodes'!R8C2:R500C3,2,FALSE)),"not allowed",VLOOKUP(RC[-2],'\\networkpath\[Costcode Table.xls]Costcodes'!R8C2:R500C3,2,FALSE))"
If IsEmpty(ActiveCell) Then Exit Sub
Thanks in Advance
Dave