lynxbci
Board Regular
- Joined
- Sep 22, 2004
- Messages
- 201
- Office Version
- 365
- Platform
- Windows
- MacOS
Hi,
I have written a function that uses vlookup and returns an input value (EVal) if an error is encountered.
I have called the function using a linked spreadsheet as the source. But it does not work, due to the following issue :-
The Table.address is not the full location of the source, it is just $A:$S
How can i ensure i am looking back at the full filename of the source data?
thanks
I have written a function that uses vlookup and returns an input value (EVal) if an error is encountered.
I have called the function using a linked spreadsheet as the source. But it does not work, due to the following issue :-
The Table.address is not the full location of the source, it is just $A:$S
How can i ensure i am looking back at the full filename of the source data?
Code:
Function ELOOKUP(Val1 As Variant, Table As Range, ResCol As Integer, TF As Boolean, Eval As Variant)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Function ELOOKUP (Error Lookup)
'Returns chosen error value (Eval) if lookup not matched
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim kls As Variant
kls = Application.VLookup(Val1, Range(Table.Address), ResCol, TF)
If IsError(kls) = False Then
ELOOKUP = kls
Else
ELOOKUP = Eval
End If
End Function
thanks