Re:trie de feuille selectionné,alphabetique numeri
un grand merci, hervé & pat
ca fonctionne a merveille
avoriaz
ci joints, macro terminer permettant mon fonctionnement
option compare text
Private Sub trie()
Sheets('bilan').Cells.ClearContents
Selection.Interior.ColorIndex = xlNone
Application.ScreenUpdating = False
Dim wsk As Worksheet
Dim Dep As Range
Dim Desti As Range
Dim c As Range
Dim plage As Range
For Each wsk In Worksheets
If wsk.Name Like '*COM*' Then
With wsk
Set Dep = .Range('A2').CurrentRegion
Set Desti = Sheets('bilan').Range('A65000').End(xlUp)(2)
Dep.Copy Desti
End With
End If
Next wsk
Sheets('bilan').Select
Range('A1').Value = 'com'
Range('B1').Value = 'code'
Range('C1').Value = 'libelle'
' tri
Range('A2').Sort Key1:=Range('A2'), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Set plage = Range('a1:a' & Range('a65536').End(xlUp).Row)
For Each c In plage
If Application.WorksheetFunction.CountIf(plage, c) > 1 Then
c.Interior.ColorIndex = 3
End If
Next c
' mise en ordre alph e num
Columns('A
').Select
Selection.Sort Key1:=Range('A1'), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub