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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
| Private Sub CHierarchisation_Click()
With Sheets("PLANACTION")
.Rows("9:65536").EntireRow.Delete
.Rows("9:65536").NumberFormat = "General"
.Rows("9:65536").Formula = Position
For Each Sh In Sheets
Select Case Sh.Name
Case "ADMINISTRATIF", "COLLECTEDECHETS", "DDD", "ESPACESVERTS", "GYPSE", "HAUTEPRESSION", "HOSPITALIER", "HÔTELLERIE", "INDUSTRIE", "INTERHAUTEUR", "LOGISTIQUE", "MECANISE", "NETTOYAGE", "SANITAIRES", "TUNNEL", "VITRERIE"
For lg = 9 To Sh.Range("A" & Rows.Count).End(xlUp).Row
LgS = .UsedRange.Rows.Count + 1
.Cells(LgS, 1) = Sh.Cells(lg, 18)
.Cells(LgS, 2) = Sh.Cells(lg, 6)
.Cells(LgS, 3) = Sh.Cells(lg, 5)
.Cells(LgS, 4) = CInt(Sh.Cells(lg, 11))
.Cells(LgS, 5) = CInt(Sh.Cells(lg, 12))
.Cells(LgS, 6) = CSng(Sh.Cells(lg, 14))
.Cells(LgS, 7) = CInt(Sh.Cells(lg, 17))
.Cells(LgS, 8) = Sh.Cells(lg, 19)
.Cells(LgS, 9) = Sh.Cells(lg, 20)
.Cells(LgS, 10) = Sh.Cells(lg, 21)
.Cells(LgS, 11) = CSng(Sh.Cells(lg, 22))
.Cells(LgS, 12) = CInt(Sh.Cells(lg, 23))
.Cells(LgS, 13) = Sh.Cells(lg, 24)
.Cells(LgS, 14) = Sh.Cells(lg, 25)
.Cells(LgS, 15) = Sh.Cells(lg, 26)
.Cells(LgS, 16) = Sh.Cells(lg, 27)
Next
Case Else
End Select
Next
Rows("9:65536").Select
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=Range("G9") _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With Worksheets("PLANACTION").Sort
.SetRange Range("A9:P1000")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End With
With Worksheets("PLANACTION")
With Range("A:P")
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.MergeCells = False
.Rows.AutoFit
End With
End With
' .HorizontalAlignment = xlGeneral
' .VerticalAlignment = xlCenter
' .WrapText = True
' .Orientation = 0
' .AddIndent = False
' .IndentLevel = 0
' .ShrinkToFit = False
' .ReadingOrder = xlContext
' .MergeCells = False
Sheets("PLANACTION").Activate
Unload FIDENTIFICATION
Unload FSECTORISATION
Unload FMAÎTRISE
Unload FPLANACTION
End Sub |
Partager