Worksheetfunction.Vlookup value on error I have this function (wb is a public workbook variable):

Function GetTiersAccount(TiersName As String, Clients As Boolean) As Long

If Clients = True Then
    On Error GoTo ERRRRR
    GetTiersAccount = WorksheetFunction.VLookup(TiersName, wb.Sheets(1).Range("A1:B13"), 2, False)
    Exit Function
Else
    On Error GoTo ERRRRR
    GetTiersAccount = WorksheetFunction.VLookup(TiersName, wb.Sheets(1).Range("D1:E94"), 2, False)
    Exit Function
End If

ERRRRR:
GetTiersAccount = 471

End Function


I feel like the way I have managed to deal with worksheetfunction.vlookup error unelegant. However I want Gettieraccount to return 471 on vlookup error.

There must be a better way to do that.
Thanks in advance.
Your handling is not necessarily unelegant, but there are a couple of things to point out.

The main thing is that you're repeating code that really only needs to be there once. For example, you only need to write the VLookup statement once. Just set up a variable to define your range. 

Your error handling can work, but you need to more clearly define what is a "normal exit" from your routine and what is an error exit. It's typical in this case to structure your error handling with the form shown below because there may be processing required during a normal exit only that you still might have to perform during an error exit.

Option Explicit

Function GetTiersAccount(TiersName As String, Clients As Boolean) As Long
    Dim lookupRange As Range
    If Clients = True Then
        Set lookupRange = wb.Sheets(1).Range("A1:B13")
    Else
        Set lookupRange = wb.Sheets(1).Range("D1:E94")
    End If

    On Error GoTo ERRRRR
    GetTiersAccount = WorksheetFunction.VLookup(TiersName, lookupRange, 2, False)

NormalExit:
    Exit Function

ERRRRR:
    GetTiersAccount = 471
    Resume NormalExit
End Function