Bonjour à toutes et à tous,
Afin de générer un userform à la suite d'un clic sur une cellule non vide dans les colonnes 2 et 3, j'ai généré le code suivant :
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ligne As Integer
Dim col As Integer
ligne = Me.Range("A:XFD").Find("lots", lookat:=xlWhole).Row
col = Me.Range("A:XFD").Find("lots", lookat:=xlWhole).Column
If Not Application.Intersect(Target, Range(Cells(ligne + 1, col), Cells(Rows.Count, col))) Is Nothing Then
If Not IsEmpty(Application.Intersect(Target, Range(Cells(ligne + 1, col), Cells(Rows.Count, col)))) Then
ajout_charges_app.Show
End If
End If
If Not Application.Intersect(Target, Range(Cells(ligne + 1, col - 1), Cells(Rows.Count, col - 1))) Is Nothing Then
If Not IsEmpty(Application.Intersect(Target, Range(Cells(ligne + 1, col - 1), Cells(Rows.Count, col - 1)))) Then
ajout_charges_imm.Show
End If
End If
End Sub
Est-il possible que le lancement de userform se fasse après le clic sur le contenu d'une cellule (comme si le contenu d'une cellule était un lien vers le userform) et non pas en cliquant sur la cellule?
Merci d'avance pour vos retours