1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
Private Sub TriHorizontal()
Dim col As Integer
col = Cells(1, 2).End(xlToRight).Column
Range("B1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveWorkbook.Worksheets("synthése").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("synthése").Sort.SortFields.Add Key:=Range(Cells(1, 2), Cells(1, col) _
), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("synthése").Sort
.SetRange Range(Cells(1, 2), Cells(13, col))
.Header = xlGuess
.MatchCase = True
.Orientation = xlLeftToRight
.SortMethod = xlPinYin
.Apply
End With
With Sheets("synthése")
.Select
Selection.NumberFormat = "0.00"
Dim cell As Range
Dim coll As Integer
coll = Cells(1, 1).End(xlToRight).Column
For Each cell In Range(Cells(1, 1), Cells(1, col))
If cell.Value = "Fils" Or cell.Value = "Fil" Or cell.Value = "fils" Or cell.Value = "fil" Or cell.Value = "File" Or cell.Value = "file" Or cell.Value = "Vide" Then
cell.Select
Columns(cell.Column).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.ClearContents
ActiveSheet.Range("A1").Select
GoTo Pol
End If
Next cell
Pol:
End With
End Sub |
Partager