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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 'ok
Dim prem_col As Integer
Dim dern_col As Integer
Dim prem_lign As Integer
Dim dern_lign As Integer
Dim synthese As String
Dim réponse As Byte
Dim saisie As String
Dim cellule_réf
Dim cellule_suppr
Dim Rg As Range
Dim Chaine As String
Chaine = "Mot 1, Mot 2, Mot 3, Mot 4, etc..."
prem_col = [I2]
dern_col = [I3]
prem_lign = [I4]
dern_lign = [I5]
Set Rg = Range(Cells([I4], [I2]), Cells([I5], [I3]))
synthese = [I11]
saisie = Target.Value
cellule_réf = Target.Address
If Not Intersect(Target, Rg) Is Nothing Then
If Target = "" Then
Target = synthese
If MsgBox("Confirmez-vous cette saisie : " & Chr(10) & Chr(10) & vbTab & synthese, vbYesNo + vbQuestion) = vbYes Then
ActiveCell.Locked = True
Else
Target = ""
End If
Cancel = True
Else
If InStr(Target.Value, Chaine) = 0 Then
MsgBox "Non non, c'est pas bon !" & vbCrLf & "Veuillez recommencer la saisie !"
Target.Value = ""
Cancel = True
End If
End If
End If
End Sub |
Partager