Bonjour à tous
Voilà j'ai un souci avec mes macros, en effet un message d'erreur intervient du type " Nom ambigu détecté : Worksheet_Change "
Pourriez vous m'aider merci
********************************************************
Private Sub Worksheet_Change(ByVal sel As Range)
Dim flt As Range ' déclaration de la position du filtre
Dim val As Range ' déclaration de la position de la cellule sélection
Set flt = Range("B6") ' position du filtre
Set val = Range("E4") ' position pour la recherche
If Not Intersect(sel, val) Is Nothing Then 'la cellule sélection est modifiée
If IsEmpty(val) Then
' suppression du filtre
val.AutoFilter
Else
' application du filtre
flt.AutoFilter Field:=4, Criteria1:="=" & val, Operator:=xlAnd
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If EnableMacros = False Then Exit Sub
Dim derlig As Long, cellule As Range
If Intersect(Target, Range("B1")) Is Nothing Then: Exit Sub
Columns(2).Interior.ColorIndex = 0
derlig = Range("B108").End(xlUp).Row
For Each cellule In Range(Cells(1, 2), Cells(derlig, 2))
If Left(cellule, 1) = "*" Then
cellule.Interior.ColorIndex = 36
End If
Next
End Sub
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If EnableMacros = False Then Exit Sub
Dim Cell As Range
If Intersect(Target, Range("B7:B166,D7:F166,J7:J166,L7:M166,R7:R166")) Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each Cell In Target
If VarType(Cell) = vbString And Not Cell.HasFormula Then Cell = UCase(Cell)
Next Cell
If Target.Column = 13 Then
If UCase(Target) <> "" Then
Target.Offset(0, 1).Value = ("P")
Else
If UCase(Target) = "" Then
Target.Offset(0, 1).ClearContents
End If
End If
End If
Application.EnableEvents = True
End Sub
********************************************************
Voilà j'ai un souci avec mes macros, en effet un message d'erreur intervient du type " Nom ambigu détecté : Worksheet_Change "
Pourriez vous m'aider merci
********************************************************
Private Sub Worksheet_Change(ByVal sel As Range)
Dim flt As Range ' déclaration de la position du filtre
Dim val As Range ' déclaration de la position de la cellule sélection
Set flt = Range("B6") ' position du filtre
Set val = Range("E4") ' position pour la recherche
If Not Intersect(sel, val) Is Nothing Then 'la cellule sélection est modifiée
If IsEmpty(val) Then
' suppression du filtre
val.AutoFilter
Else
' application du filtre
flt.AutoFilter Field:=4, Criteria1:="=" & val, Operator:=xlAnd
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If EnableMacros = False Then Exit Sub
Dim derlig As Long, cellule As Range
If Intersect(Target, Range("B1")) Is Nothing Then: Exit Sub
Columns(2).Interior.ColorIndex = 0
derlig = Range("B108").End(xlUp).Row
For Each cellule In Range(Cells(1, 2), Cells(derlig, 2))
If Left(cellule, 1) = "*" Then
cellule.Interior.ColorIndex = 36
End If
Next
End Sub
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If EnableMacros = False Then Exit Sub
Dim Cell As Range
If Intersect(Target, Range("B7:B166,D7:F166,J7:J166,L7:M166,R7:R166")) Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each Cell In Target
If VarType(Cell) = vbString And Not Cell.HasFormula Then Cell = UCase(Cell)
Next Cell
If Target.Column = 13 Then
If UCase(Target) <> "" Then
Target.Offset(0, 1).Value = ("P")
Else
If UCase(Target) = "" Then
Target.Offset(0, 1).ClearContents
End If
End If
End If
Application.EnableEvents = True
End Sub
********************************************************