Pensant avoir compris le conseil de ce jour de FFO, j'ai voulu
l'appliquer à ce qui suit ; ça ne fonctionne pas !
(Nota : la première partie est censée remplacé ce qui est commenté)
'--------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
For i = 9 To 14
If Cells(2, i) <> "Trié" Then Range(Cells(2, i), Cells(65536,
i).End(xlUp)).Sort Key1:=Cells(2, i)
Next
' If [i2] <> "Trié" Then Range([b2], [b65536].End(xlUp)).Sort
Key1:=[b2]
' If [j2] <> "Trié" Then Range([c2], [c65536].End(xlUp)).Sort
Key1:=[c2]
' If [k2] <> "Trié" Then Range([d2], [d65536].End(xlUp)).Sort
Key1:=[d2]
' If [l2] <> "Trié" Then Range([e2], [e65536].End(xlUp)).Sort
Key1:=[e2]
' If [m2] <> "Trié" Then Range([f2], [f65536].End(xlUp)).Sort
Key1:=[f2]
' If [n2] <> "Trié" Then Range([g2], [g65536].End(xlUp)).Sort
Key1:=[g2]
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
LSteph
Bonsoir,
j'aurais bien vu un select case non!?
et avec un worksheet_change .. EnableEvents irait bien.
@+
-- lSteph
j-pascal a écrit :
Bonsoir,
Pensant avoir compris le conseil de ce jour de FFO, j'ai voulu l'appliquer à ce qui suit ; ça ne fonctionne pas !
(Nota : la première partie est censée remplacé ce qui est commenté)
'--------------
Private Sub Worksheet_Change(ByVal Target As Range) Dim i As Integer
For i = 9 To 14 If Cells(2, i) <> "Trié" Then Range(Cells(2, i), Cells(65536, i).End(xlUp)).Sort Key1:Îlls(2, i) Next
' If [i2] <> "Trié" Then Range([b2], [b65536].End(xlUp)).Sort Key1:=[b2] ' If [j2] <> "Trié" Then Range([c2], [c65536].End(xlUp)).Sort Key1:=[c2] ' If [k2] <> "Trié" Then Range([d2], [d65536].End(xlUp)).Sort Key1:=[d2] ' If [l2] <> "Trié" Then Range([e2], [e65536].End(xlUp)).Sort Key1:=[e2] ' If [m2] <> "Trié" Then Range([f2], [f65536].End(xlUp)).Sort Key1:=[f2] ' If [n2] <> "Trié" Then Range([g2], [g65536].End(xlUp)).Sort Key1:=[g2]
End Sub
'--------------
Merci pour votre aide,
JP
Bonsoir,
j'aurais bien vu un select case
non!?
et avec un worksheet_change .. EnableEvents
irait bien.
@+
--
lSteph
j-pascal a écrit :
Bonsoir,
Pensant avoir compris le conseil de ce jour de FFO, j'ai voulu
l'appliquer à ce qui suit ; ça ne fonctionne pas !
(Nota : la première partie est censée remplacé ce qui est commenté)
'--------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
For i = 9 To 14
If Cells(2, i) <> "Trié" Then Range(Cells(2, i), Cells(65536,
i).End(xlUp)).Sort Key1:Îlls(2, i)
Next
' If [i2] <> "Trié" Then Range([b2], [b65536].End(xlUp)).Sort Key1:=[b2]
' If [j2] <> "Trié" Then Range([c2], [c65536].End(xlUp)).Sort Key1:=[c2]
' If [k2] <> "Trié" Then Range([d2], [d65536].End(xlUp)).Sort Key1:=[d2]
' If [l2] <> "Trié" Then Range([e2], [e65536].End(xlUp)).Sort Key1:=[e2]
' If [m2] <> "Trié" Then Range([f2], [f65536].End(xlUp)).Sort Key1:=[f2]
' If [n2] <> "Trié" Then Range([g2], [g65536].End(xlUp)).Sort Key1:=[g2]
et avec un worksheet_change .. EnableEvents irait bien.
@+
-- lSteph
j-pascal a écrit :
Bonsoir,
Pensant avoir compris le conseil de ce jour de FFO, j'ai voulu l'appliquer à ce qui suit ; ça ne fonctionne pas !
(Nota : la première partie est censée remplacé ce qui est commenté)
'--------------
Private Sub Worksheet_Change(ByVal Target As Range) Dim i As Integer
For i = 9 To 14 If Cells(2, i) <> "Trié" Then Range(Cells(2, i), Cells(65536, i).End(xlUp)).Sort Key1:Îlls(2, i) Next
' If [i2] <> "Trié" Then Range([b2], [b65536].End(xlUp)).Sort Key1:=[b2] ' If [j2] <> "Trié" Then Range([c2], [c65536].End(xlUp)).Sort Key1:=[c2] ' If [k2] <> "Trié" Then Range([d2], [d65536].End(xlUp)).Sort Key1:=[d2] ' If [l2] <> "Trié" Then Range([e2], [e65536].End(xlUp)).Sort Key1:=[e2] ' If [m2] <> "Trié" Then Range([f2], [f65536].End(xlUp)).Sort Key1:=[f2] ' If [n2] <> "Trié" Then Range([g2], [g65536].End(xlUp)).Sort Key1:=[g2]
End Sub
'--------------
Merci pour votre aide,
JP
j-pascal
Bonsoir Stéphane,
Ok, je vais essayé (si je trouve car je n'ai jamais utilisé ...)
@+
JP
Bonsoir,
j'aurais bien vu un select case non!?
et avec un worksheet_change .. EnableEvents irait bien.
@+
-- lSteph
j-pascal a écrit :
Bonsoir,
Pensant avoir compris le conseil de ce jour de FFO, j'ai voulu l'appliquer à ce qui suit ; ça ne fonctionne pas !
(Nota : la première partie est censée remplacé ce qui est commenté)
'--------------
Private Sub Worksheet_Change(ByVal Target As Range) Dim i As Integer
For i = 9 To 14 If Cells(2, i) <> "Trié" Then Range(Cells(2, i), Cells(65536, i).End(xlUp)).Sort Key1:Îlls(2, i) Next
' If [i2] <> "Trié" Then Range([b2], [b65536].End(xlUp)).Sort Key1:=[b2] ' If [j2] <> "Trié" Then Range([c2], [c65536].End(xlUp)).Sort Key1:=[c2] ' If [k2] <> "Trié" Then Range([d2], [d65536].End(xlUp)).Sort Key1:=[d2] ' If [l2] <> "Trié" Then Range([e2], [e65536].End(xlUp)).Sort Key1:=[e2] ' If [m2] <> "Trié" Then Range([f2], [f65536].End(xlUp)).Sort Key1:=[f2] ' If [n2] <> "Trié" Then Range([g2], [g65536].End(xlUp)).Sort Key1:=[g2]
End Sub
'--------------
Merci pour votre aide,
JP
Bonsoir Stéphane,
Ok, je vais essayé (si je trouve car je n'ai jamais utilisé ...)
@+
JP
Bonsoir,
j'aurais bien vu un select case
non!?
et avec un worksheet_change .. EnableEvents
irait bien.
@+
--
lSteph
j-pascal a écrit :
Bonsoir,
Pensant avoir compris le conseil de ce jour de FFO, j'ai voulu l'appliquer
à ce qui suit ; ça ne fonctionne pas !
(Nota : la première partie est censée remplacé ce qui est commenté)
'--------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
For i = 9 To 14
If Cells(2, i) <> "Trié" Then Range(Cells(2, i), Cells(65536,
i).End(xlUp)).Sort Key1:Îlls(2, i)
Next
' If [i2] <> "Trié" Then Range([b2], [b65536].End(xlUp)).Sort Key1:=[b2]
' If [j2] <> "Trié" Then Range([c2], [c65536].End(xlUp)).Sort Key1:=[c2]
' If [k2] <> "Trié" Then Range([d2], [d65536].End(xlUp)).Sort Key1:=[d2]
' If [l2] <> "Trié" Then Range([e2], [e65536].End(xlUp)).Sort Key1:=[e2]
' If [m2] <> "Trié" Then Range([f2], [f65536].End(xlUp)).Sort Key1:=[f2]
' If [n2] <> "Trié" Then Range([g2], [g65536].End(xlUp)).Sort Key1:=[g2]
Ok, je vais essayé (si je trouve car je n'ai jamais utilisé ...)
@+
JP
Bonsoir,
j'aurais bien vu un select case non!?
et avec un worksheet_change .. EnableEvents irait bien.
@+
-- lSteph
j-pascal a écrit :
Bonsoir,
Pensant avoir compris le conseil de ce jour de FFO, j'ai voulu l'appliquer à ce qui suit ; ça ne fonctionne pas !
(Nota : la première partie est censée remplacé ce qui est commenté)
'--------------
Private Sub Worksheet_Change(ByVal Target As Range) Dim i As Integer
For i = 9 To 14 If Cells(2, i) <> "Trié" Then Range(Cells(2, i), Cells(65536, i).End(xlUp)).Sort Key1:Îlls(2, i) Next
' If [i2] <> "Trié" Then Range([b2], [b65536].End(xlUp)).Sort Key1:=[b2] ' If [j2] <> "Trié" Then Range([c2], [c65536].End(xlUp)).Sort Key1:=[c2] ' If [k2] <> "Trié" Then Range([d2], [d65536].End(xlUp)).Sort Key1:=[d2] ' If [l2] <> "Trié" Then Range([e2], [e65536].End(xlUp)).Sort Key1:=[e2] ' If [m2] <> "Trié" Then Range([f2], [f65536].End(xlUp)).Sort Key1:=[f2] ' If [n2] <> "Trié" Then Range([g2], [g65536].End(xlUp)).Sort Key1:=[g2]
End Sub
'--------------
Merci pour votre aide,
JP
j-pascal
Re,
Merci pour ta proposition. Non, non, ce n'est pas encore ce soir que je m'initierai aux "Select Case".
En fait, j'ai fait une erreur : si "I2" <> "trié", c'est la colonne "B" qui doit être triée !! Donc il suffit de décaler la variable "i" de "-7" et ça fonctionne !
If Cells(2, i) <> "Trié" Then Range(Cells(2, i - 7), Cells(65536, i - 7).End(xlUp)).Sort Key1:Îlls(2, i - 7)
@+ pour les select case
JP
PS : a priori le "Application.EnableEvents = True" si ce dont tu parlais, n'est pas indispensable.
Bonsoir,
j'aurais bien vu un select case non!?
et avec un worksheet_change .. EnableEvents irait bien.
@+
-- lSteph
j-pascal a écrit :
Bonsoir,
Pensant avoir compris le conseil de ce jour de FFO, j'ai voulu l'appliquer à ce qui suit ; ça ne fonctionne pas !
(Nota : la première partie est censée remplacé ce qui est commenté)
'--------------
Private Sub Worksheet_Change(ByVal Target As Range) Dim i As Integer
For i = 9 To 14 If Cells(2, i) <> "Trié" Then Range(Cells(2, i), Cells(65536, i).End(xlUp)).Sort Key1:Îlls(2, i) Next
' If [i2] <> "Trié" Then Range([b2], [b65536].End(xlUp)).Sort Key1:=[b2] ' If [j2] <> "Trié" Then Range([c2], [c65536].End(xlUp)).Sort Key1:=[c2] ' If [k2] <> "Trié" Then Range([d2], [d65536].End(xlUp)).Sort Key1:=[d2] ' If [l2] <> "Trié" Then Range([e2], [e65536].End(xlUp)).Sort Key1:=[e2] ' If [m2] <> "Trié" Then Range([f2], [f65536].End(xlUp)).Sort Key1:=[f2] ' If [n2] <> "Trié" Then Range([g2], [g65536].End(xlUp)).Sort Key1:=[g2]
End Sub
'--------------
Merci pour votre aide,
JP
Re,
Merci pour ta proposition.
Non, non, ce n'est pas encore ce soir que je m'initierai aux "Select
Case".
En fait, j'ai fait une erreur : si "I2" <> "trié", c'est la colonne "B"
qui doit être triée !! Donc il suffit de décaler la variable "i" de
"-7" et ça fonctionne !
If Cells(2, i) <> "Trié" Then Range(Cells(2, i - 7), Cells(65536, i -
7).End(xlUp)).Sort Key1:Îlls(2, i - 7)
@+ pour les select case
JP
PS : a priori le "Application.EnableEvents = True" si ce dont tu
parlais, n'est pas indispensable.
Bonsoir,
j'aurais bien vu un select case
non!?
et avec un worksheet_change .. EnableEvents
irait bien.
@+
--
lSteph
j-pascal a écrit :
Bonsoir,
Pensant avoir compris le conseil de ce jour de FFO, j'ai voulu l'appliquer
à ce qui suit ; ça ne fonctionne pas !
(Nota : la première partie est censée remplacé ce qui est commenté)
'--------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
For i = 9 To 14
If Cells(2, i) <> "Trié" Then Range(Cells(2, i), Cells(65536,
i).End(xlUp)).Sort Key1:Îlls(2, i)
Next
' If [i2] <> "Trié" Then Range([b2], [b65536].End(xlUp)).Sort Key1:=[b2]
' If [j2] <> "Trié" Then Range([c2], [c65536].End(xlUp)).Sort Key1:=[c2]
' If [k2] <> "Trié" Then Range([d2], [d65536].End(xlUp)).Sort Key1:=[d2]
' If [l2] <> "Trié" Then Range([e2], [e65536].End(xlUp)).Sort Key1:=[e2]
' If [m2] <> "Trié" Then Range([f2], [f65536].End(xlUp)).Sort Key1:=[f2]
' If [n2] <> "Trié" Then Range([g2], [g65536].End(xlUp)).Sort Key1:=[g2]
Merci pour ta proposition. Non, non, ce n'est pas encore ce soir que je m'initierai aux "Select Case".
En fait, j'ai fait une erreur : si "I2" <> "trié", c'est la colonne "B" qui doit être triée !! Donc il suffit de décaler la variable "i" de "-7" et ça fonctionne !
If Cells(2, i) <> "Trié" Then Range(Cells(2, i - 7), Cells(65536, i - 7).End(xlUp)).Sort Key1:Îlls(2, i - 7)
@+ pour les select case
JP
PS : a priori le "Application.EnableEvents = True" si ce dont tu parlais, n'est pas indispensable.
Bonsoir,
j'aurais bien vu un select case non!?
et avec un worksheet_change .. EnableEvents irait bien.
@+
-- lSteph
j-pascal a écrit :
Bonsoir,
Pensant avoir compris le conseil de ce jour de FFO, j'ai voulu l'appliquer à ce qui suit ; ça ne fonctionne pas !
(Nota : la première partie est censée remplacé ce qui est commenté)
'--------------
Private Sub Worksheet_Change(ByVal Target As Range) Dim i As Integer
For i = 9 To 14 If Cells(2, i) <> "Trié" Then Range(Cells(2, i), Cells(65536, i).End(xlUp)).Sort Key1:Îlls(2, i) Next
' If [i2] <> "Trié" Then Range([b2], [b65536].End(xlUp)).Sort Key1:=[b2] ' If [j2] <> "Trié" Then Range([c2], [c65536].End(xlUp)).Sort Key1:=[c2] ' If [k2] <> "Trié" Then Range([d2], [d65536].End(xlUp)).Sort Key1:=[d2] ' If [l2] <> "Trié" Then Range([e2], [e65536].End(xlUp)).Sort Key1:=[e2] ' If [m2] <> "Trié" Then Range([f2], [f65536].End(xlUp)).Sort Key1:=[f2] ' If [n2] <> "Trié" Then Range([g2], [g65536].End(xlUp)).Sort Key1:=[g2]