Bonjour,
J'ai un problème avec le code suivant.
j'ai un tableau en deux colonnes, l'une pour les username et l'autre pour le profil

Le code bloque quand le username n'est pas présent dans le tableau
Je voudrais que s'il n'est pas présent il lance "call affichage"

merci pour votre aide

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
 
    Dim user As String, profil As String
 
    user = Application.UserName
 
    profil = Application.WorksheetFunction.VLookup(user, Sheets("setup").Range("E3:F14"), 2, 0)
 
    Application.ScreenUpdating = False
    If Not Application.Intersect(Target, Range("A3")) Is Nothing Then
         'procèdure selon username.system
            If profil = "F" Then
            Call AffichageF
            Else
                If profil = "R" Then
                Call AffichageR
                Else
                Call Affichage
                End If
            Call Affichage
            ActiveWindow.DisplayHorizontalScrollBar = True
            End If
            Application.ScreenUpdating = True
    End If
    Application.ScreenUpdating = True
 
End Sub