Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

erreure dans tri

2 réponses
Avatar
Christian
Bonjour,

j'ai une erreure 1004 dans la fonction suivante à la dernière instruction
".Apply" :

Sub trimanche1Place()
'
' trimanche1Place Macro
'

'
Dim NbrLignes, IndexLigne


NbrLignes = Participants.Range("K10").Value
IndexLigne = 132 - (130 - NbrLignes)


Range(Cells(3, 2), Cells(IndexLigne, 8)).Select



'Range("B3:H132").Select
ActiveWorkbook.Worksheets("Feuille
inscriptions").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Feuille inscriptions").Sort.SortFields.Add
Key:= _
Range(Cells(3, 2), Cells(IndexLigne, 8)), SortOn:=xlSortOnValues,
Order:=xlAscending, DataOption _
:=xlSortNormal
With ActiveWorkbook.Worksheets("Feuille inscriptions").Sort
.SetRange Range(Cells(3, 2), Cells(IndexLigne, 8))
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub


Merci d'avance

2 réponses

Avatar
Daniel.C
Bonjour.
En admettant que tu veuilles trier su la colonne B, mets :

With ActiveWorkbook.Worksheets("Feuille inscriptions").Sort
.SetRange Range(Cells(3, 2), Cells(IndexLigne, 8))
.SortFields.Add Key:= _
Range(Cells(3, 2), Cells(IndexLigne, 2)), SortOn:=xlSortOnValues,
Order:=xlAscending, DataOption _
:=xlSortNormal
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With

Cordialement.
Daniel

"Christian" a écrit dans le message de news:

Bonjour,

j'ai une erreure 1004 dans la fonction suivante à la dernière instruction
".Apply" :

Sub trimanche1Place()
'
' trimanche1Place Macro
'

'
Dim NbrLignes, IndexLigne


NbrLignes = Participants.Range("K10").Value
IndexLigne = 132 - (130 - NbrLignes)


Range(Cells(3, 2), Cells(IndexLigne, 8)).Select



'Range("B3:H132").Select
ActiveWorkbook.Worksheets("Feuille
inscriptions").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Feuille inscriptions").Sort.SortFields.Add
Key:= _
Range(Cells(3, 2), Cells(IndexLigne, 8)), SortOn:=xlSortOnValues,
Order:=xlAscending, DataOption _
:=xlSortNormal
With ActiveWorkbook.Worksheets("Feuille inscriptions").Sort
.SetRange Range(Cells(3, 2), Cells(IndexLigne, 8))
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub


Merci d'avance


Avatar
Christian
Merci

Christian

"Daniel.C" écrivait
news:e1KKlMX#:

Bonjour.
En admettant que tu veuilles trier su la colonne B, mets :

With ActiveWorkbook.Worksheets("Feuille inscriptions").Sort
.SetRange Range(Cells(3, 2), Cells(IndexLigne, 8))
.SortFields.Add Key:= _
Range(Cells(3, 2), Cells(IndexLigne, 2)),
SortOn:=xlSortOnValues,
Order:=xlAscending, DataOption _
:=xlSortNormal
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With

Cordialement.
Daniel

"Christian" a écrit dans le message de
news:
Bonjour,

j'ai une erreure 1004 dans la fonction suivante à la dernière
instruction ".Apply" :

Sub trimanche1Place()
'
' trimanche1Place Macro
'

'
Dim NbrLignes, IndexLigne


NbrLignes = Participants.Range("K10").Value
IndexLigne = 132 - (130 - NbrLignes)


Range(Cells(3, 2), Cells(IndexLigne, 8)).Select



'Range("B3:H132").Select
ActiveWorkbook.Worksheets("Feuille
inscriptions").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Feuille
inscriptions").Sort.SortFields.Add
Key:= _
Range(Cells(3, 2), Cells(IndexLigne, 8)),
SortOn:=xlSortOnValues,
Order:=xlAscending, DataOption _
:=xlSortNormal
With ActiveWorkbook.Worksheets("Feuille inscriptions").Sort
.SetRange Range(Cells(3, 2), Cells(IndexLigne, 8))
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub


Merci d'avance