Solved: Vlookup in VBA - problems
I received an set of reference numbers who paid their premiums each month, unfortunately if wasn't in a list by an array. I wrote a function that checks if a certain reference number appears in this array, and everything worked great until I tried the formula in another sheet, I've copied the code below! Please help!!!
[vba]Function PREMIUMFINDER(VALUE)
Dim TELLER As Integer
TELLER = 14
Do Until TELLER = 260
PREMIUMFINDER = Application.VLookup(VALUE, _
Sheets("PREMIUM RECON").Range(Cells(4, TELLER), Cells(477, 26)), 1, _
False)
If IsError(PREMIUMFINDER) Then
TELLER = TELLER + 1
Else
Exit Do
End If
Loop
End Function[/vba] [uvba].[/uvba]