cs_aurelie34
Messages postés1Date d'inscriptionvendredi 26 novembre 2010StatutMembreDernière intervention30 novembre 2010
-
30 nov. 2010 à 20:04
CGSI3
Messages postés416Date d'inscriptionvendredi 22 février 2008StatutMembreDerniè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