Bonjour
J'ai un problème dans un code VBA
Sur une même feuille j'ai ce code le premier code fonctionne bien seul
Le deuxième également les 2 associés forment un beug avec les lignes Private Sub
Comment résoudre le problème pour que tout cela fonctionne
Je vous remercie
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Range("C2:I65"), Target) Is Nothing And Target <> "" Then
Application.EnableEvents = False
Target = Application.Proper(Target)
Application.EnableEvents = True
End If
End Sub
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim tablo As Range
Dim nom$, nomI$
Set tablo = Range("B1").CurrentRegion
If Not Intersect(Target, tablo) Is Nothing _
And (Target.Column = 3 Or Target.Column = 5 _
Or Target.Column = 7 Or Target.Column = 9) Then
Application.EnableEvents = False
nom = Target.Value
If Target.Value = "" Then GoTo fin
Application.Undo
nomI = ActiveCell.Value
If nomI <> "" Then GoTo fin
Target.Value = Target.Offset(0, -1) & " " & nom
End If
fin:
Application.EnableEvents = True
End Sub
Sub Evenement()
Application.EnableEvents = True
End Sub