Tableau excel et userform

cs_aurelie34 Messages postés 1 Date d'inscription vendredi 26 novembre 2010 Statut Membre Dernière intervention 30 novembre 2010 - 30 nov. 2010 à 20:04
CGSI3 Messages postés 416 Date d'inscription vendredi 22 février 2008 Statut Membre Dernière intervention 7 janvier 2018 - 30 nov. 2010 à 20:42
Bonjour,

j'ai eu besoin de créer un userform dans lequel j'ai inséré un tableau excel (spreadsheet de owc11). Cepedant je n'arrive pas a détecter un clic de souris dans le tableau excel du userform.

Le code est le suivant :

Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Long) As Long

Private Sub Spreadsheet1_BeforeRightClick(ByVal target As Range, cancel As Boolean)

cancel = True
MsgBox ("clic_droit")
If UserForm1.Spreadsheet1.Sheets("Feuil1").target.Interior.ColorIndex = 1 Then
MsgBox ("Clique sur une case Bleu")
End If
End Sub

Private Sub Spreadsheet1_SlectionChange(ByVal target As Range)

If GetAsyncKeyState(2&) Then 'Si il y a un clic droit on n'exécute pas ce clic gauche
Exit Sub
End If
If target.Interior.ColorIndex = 1 Then
MsgBox ("Clique sur une case Bleu")
End If

End Sub

Auriez-vous une idée de comment faire ?

Merci

1 réponse

CGSI3 Messages postés 416 Date d'inscription vendredi 22 février 2008 Statut Membre Dernière intervention 7 janvier 2018 1
30 nov. 2010 à 20:42
Bonsoir,
Pas sur, mais before cela ne veut pas dire avant
"Spreadsheet1_BeforeRightClick"
il n'existe pas la même fonction en "AfterRightClick ?
CGSI3
0
Rejoignez-nous