Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I trap this Vlookup error in a VBA macro
Hi,
I have a need to identify whether a Job Number appears in a specific range, and take different actions in a mcaro dependent on whether it is or isn't present. As a function this would simply be =If(Iserror( Vlookup(x,MyRange,1,false)),"This","That") However I'm having difficulties building this into a macro using Application.WorksheetFunction. I keep stumbling on the 'Unable to get the Vlookup property of the Worksheet Function Class" where the job number doesn't exist I've also tried MyRange.Find(what:=JobNo, after ............etc., but get the 'Object Variable with Block Variable not set' error, where the jobs doesn't exist. How can I construct an If "JobNo exists" Then "This" else "That" End If test? Usual TIA __ Richard Buttrey Grappenhall, Cheshire, UK __________________________ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I want to trap an error I get in a macro | Excel Programming | |||
Error Handling - On Error GoTo doesn't trap error successfully | Excel Programming | |||
Error Trap | Excel Programming | |||
error trap | Excel Programming |