Bonjour à tous,
Comme d'habitude, je m'adresse à cet excellent forum pour trouver une réponse à mon problème.
J'ai sur plusieurs feuilles la macro suivante :
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long
Application.ScreenUpdating = False
If Target.Address = "$A$3" Then
Range("C1:IV1").EntireColumn.Hidden = False
If Target.Value <> "" Then
For i = 3 To 120
If Cells(1, i).Value <> UCase(Target.Value) Then
Cells(1, i).EntireColumn.Hidden = True
End If
Next i
End If
End If
If Target.Address = "$A$5" Then
Range("C2:IV2").EntireColumn.Hidden = False
If Target.Value <> "" Then
For i = 3 To 120
If Cells(2, i).Value <> UCase(Target.Value) Then
Cells(2, i).EntireColumn.Hidden = True
End If
Next i
End If
End If
If Target.Address = "$A$1" Then
Range("IV:IV").EntireRow.Hidden = False
If Target.Value <> "" Then
For i = 7 To 682
If Cells(i, 256).Value <> UCase(Target.Value) Then
Cells(i, 256).EntireRow.Hidden = True
End If
Next i
End If
End If
Application.ScreenUpdating = True
End Sub
Cette macro se lance grace à trois cellules qui sont sous forme de validation.
Elles servent à modifier l'affichage de la feuille afin d'imprimer une partie des éléments.
Lors l'activation de cette macro,surtout pour la case A1,le traitement est très long.
Pouvez vous m'aider à la simplifier ?
Merci pour votre aide
Dirmon
Comme d'habitude, je m'adresse à cet excellent forum pour trouver une réponse à mon problème.
J'ai sur plusieurs feuilles la macro suivante :
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long
Application.ScreenUpdating = False
If Target.Address = "$A$3" Then
Range("C1:IV1").EntireColumn.Hidden = False
If Target.Value <> "" Then
For i = 3 To 120
If Cells(1, i).Value <> UCase(Target.Value) Then
Cells(1, i).EntireColumn.Hidden = True
End If
Next i
End If
End If
If Target.Address = "$A$5" Then
Range("C2:IV2").EntireColumn.Hidden = False
If Target.Value <> "" Then
For i = 3 To 120
If Cells(2, i).Value <> UCase(Target.Value) Then
Cells(2, i).EntireColumn.Hidden = True
End If
Next i
End If
End If
If Target.Address = "$A$1" Then
Range("IV:IV").EntireRow.Hidden = False
If Target.Value <> "" Then
For i = 7 To 682
If Cells(i, 256).Value <> UCase(Target.Value) Then
Cells(i, 256).EntireRow.Hidden = True
End If
Next i
End If
End If
Application.ScreenUpdating = True
End Sub
Cette macro se lance grace à trois cellules qui sont sous forme de validation.
Elles servent à modifier l'affichage de la feuille afin d'imprimer une partie des éléments.
Lors l'activation de cette macro,surtout pour la case A1,le traitement est très long.
Pouvez vous m'aider à la simplifier ?
Merci pour votre aide
Dirmon