Bonjour,
J'ai un problème avec ce code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim ligne As Integer
On Error GoTo finerreur
'Traitement de TERM par double-clic
If (Target.Column <> 8 Or Target.Row < 3) Then Exit Sub
Cancel = True 'évite le mode "Édition" lié au double-clic
ligne = ActiveCell.Row
If ActiveCell.Value = "Term" Then
Range("A" & ligne & ":H" & ligne).Interior.ColorIndex = xlNone ' Fond transparent
Range("H" & ligne).FormulaR1C1 = ""
Range("H" & ligne).Select
Exit Sub
End If
Range("A" & ligne & ":H" & ligne).Interior.ColorIndex = 15 ' Fond gris
Range("H" & ligne).FormulaR1C1 = "Term"
Range("H" & ligne).Characters.Font.ColorIndex = 5
Range("H" & ligne).Characters.Font.FontStyle = "Gras"
Exit Sub
finerreur:
MsgBox " problème !"
End Sub[/SIZE]
Le déroulement de la macro ne se fait que partiellement ... ?
J'ai bien essayé avec Target à la place d'activecell mais rien n'y fait.
Une idée ?
J'ai un problème avec ce code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim ligne As Integer
On Error GoTo finerreur
'Traitement de TERM par double-clic
If (Target.Column <> 8 Or Target.Row < 3) Then Exit Sub
Cancel = True 'évite le mode "Édition" lié au double-clic
ligne = ActiveCell.Row
If ActiveCell.Value = "Term" Then
Range("A" & ligne & ":H" & ligne).Interior.ColorIndex = xlNone ' Fond transparent
Range("H" & ligne).FormulaR1C1 = ""
Range("H" & ligne).Select
Exit Sub
End If
Range("A" & ligne & ":H" & ligne).Interior.ColorIndex = 15 ' Fond gris
Range("H" & ligne).FormulaR1C1 = "Term"
Range("H" & ligne).Characters.Font.ColorIndex = 5
Range("H" & ligne).Characters.Font.FontStyle = "Gras"
Exit Sub
finerreur:
MsgBox " problème !"
End Sub[/SIZE]
Le déroulement de la macro ne se fait que partiellement ... ?
J'ai bien essayé avec Target à la place d'activecell mais rien n'y fait.
Une idée ?