Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() this is my original function, works fine, however the lookup range can vary greatly, 2nd version is below, not quite working, help on this one is much appreciated Function taz(a, b) As Variant Dim res As Variant res = Application.VLookup(a, Range("Jobs!$A$1:$F$65000"), b, 0) If IsError(res) Then res = Application.VLookup(a, Range("Jobs!$A$1:$F$65000"), b, 0) End If If IsError(res) Then taz = 0 Else taz = res End If End Function Version 2: Function taz(a, b,c,d,e,f) As Variant Dim res As Variant res = Application.VLookup(a, Range(Sheets("Jobs").Cells(c,d),Sheets("Jobs").Cel ls(e,f)), b, 0) If IsError(res) Then res = Application.VLookup(a, Range(Sheets("Jobs").Cells(c,d),Sheets("Jobs").Cel ls(e,f)), b, 0) End If If IsError(res) Then taz = 0 Else taz = res End If End Function -- T De Villiers ------------------------------------------------------------------------ T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479 View this thread: http://www.excelforum.com/showthread...hreadid=567917 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If (Vlookup 0) working, but what if Vlookup cell does not exist | Excel Worksheet Functions | |||
VLookUp - Does the VLookUp return the exact information? | Excel Worksheet Functions | |||
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP | Excel Discussion (Misc queries) | |||
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) | New Users to Excel | |||
Vlookup info being used without vlookup table attached? | Excel Worksheet Functions |