Bonjour leForum,
J'ai besoin d'aide sur ce petit code.
Via un usf, je remplie une Bdd dans la Feuille "COMPTES"
Dans la feuille "INTERFACE", je fais un AdvancedFilter (code suivant)
Cela marche super bien :
Mais la mise à jour ne se fait pas en auto quand je modifie la Base .....
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 Private Sub Worksheet_Change(ByVal Target As Range) Dim Donnees As Range Application.ScreenUpdating = False Application.EnableEvents = False If Not Intersect([R9:W10], Target) Is Nothing Then Sheets("COMPTES").[A1:S10000].AdvancedFilter Action:=xlFilterCopy, _ CriteriaRange:=Range("R8").CurrentRegion, CopyToRange:=[M7:O7] End If Range("C2").Select Application.EnableEvents = True Application.ScreenUpdating = True End Sub
Du coup, j'essaye de modifier le code en disant :
Si modification dans la base (Feuille "COMPTES") --> AdvancedFilter dans la feuille "INTERFACE"
Je dois pas en être loin mais pas de mise à jour
QQn aurait une idée ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 Private Sub Worksheet_Change(ByVal Target As Range) Dim Donnees As Range Donnees = Worksheet("COMPTES").a1.CurrentRegion.Select Application.ScreenUpdating = False Application.EnableEvents = False If Not Intersect(Donnees, Target) Is Nothing Then Sheets("COMPTES").[A1:S10000].AdvancedFilter Action:=xlFilterCopy, _ CriteriaRange:=Range("R8").CurrentRegion, CopyToRange:=[M7:O7] End If Range("C2").Select Application.EnableEvents = True Application.ScreenUpdating = True End Sub
Partager