1 2 3 4 5 6 7 8 9 10 11 12
| Private Sub worksheet_BeforeDoubleClick(ByVal target As Range, cancel As Boolean)
If Not Intersect(target, [E2:AD43]) Is Nothing Then
cancel = True
If Nom_V = "" Then 'ici, tu dis "si target est vide"
Nom_V = target '... ta variable prend la valeur de ta cellule vide
target.ClearContents 'là tu effaces une cellule VIDE
Else 'sinon, si target n'est pas vide, tu la vides puisque Nom_V est vide, obligatoirement
Range(target.Address) = Nom_V 'là, je t'ai déjà corrigé, target = Nom_V
Nom_V = ""
End If
End If
End Sub |