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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
| Sub Nouveau_client()
Sheets(2).Select
a1 = "A1"
r = 1
c = 1
**While Cells(r, c) <> ""**
r = r + 1
Wend
Cells(1, 5).Value = r
Cells(2, 5).Value = "C"
Cells(3, 5).FormulaR1C1 = "=CONCATENATE(r[-1]c,r[-2]c)"
a2 = Cells(3, 5).Value
Cells(2, 5).Value = "B"
Cells(3, 5).FormulaR1C1 = "=CONCATENATE(r[-1]c,r[-2]c)"
a21 = Cells(3, 5).Value
Cells(2, 5).Value = "A"
Cells(3, 5).FormulaR1C1 = "=CONCATENATE(r[-1]c,r[-2]c)"
a3 = Cells(3, 5).Value
Cells(1, 5).Value = r - 1
Cells(3, 5).FormulaR1C1 = "=CONCATENATE(r[-1]c,r[-2]c)"
a4 = Cells(3, 5).Value
Cells(1, 5).Value = a1
Cells(2, 5).Value = a2
Cells(3, 5).Value = ":"
Cells(4, 5).FormulaR1C1 = "=CONCATENATE(r[-3]c,r[-1]c,r[-2]c)"
plage = Cells(4, 5).Value
Cells(1, 5).Value = a4
Cells(2, 5).Value = a3
Cells(4, 5).FormulaR1C1 = "=CONCATENATE(r[-3]c,r[-1]c,r[-2]c)"
plage1 = Cells(4, 5).Value
Cells(1, 5).Value = a1
Cells(2, 5).Value = a21
Cells(4, 5).FormulaR1C1 = "=CONCATENATE(r[-3]c,r[-1]c,r[-2]c)"
plagegraph1 = Cells(4, 5).Value
Range("E1:E4").Delete
For i = 2 To Sheets.Count
Worksheets(i).Activate
Rows(r).Insert shift:=xlDown
Cells(r - 1, 1).Select
Selection.AutoFill Destination:=Range(plage1), Type:=xlFillDefault
Range(plage).Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.ChartObjects("Graphique 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.SetSourceData Source:=ActiveSheet.Range(plagegraph1), _
PlotBy:=xlColumns
Next i
Sheets(1).Select
Cells(1, 8).Value = r
Cells(2, 8).Value = "F"
Cells(3, 8).FormulaR1C1 = "=CONCATENATE(r[-1]c,r[-2]c)"
a2 = Cells(3, 8).Value
Cells(1, 8).Value = a1
Cells(2, 8).Value = a2
Cells(3, 8).Value = ":"
Cells(4, 8).FormulaR1C1 = "=CONCATENATE(r[-3]c,r[-1]c,r[-2]c)"
plage = Cells(4, 8).Value
Range("H1:H4").Delete
Range(plage).Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Sheets(2).Select
**Cells(1, 5).Value = r**
Cells(2, 5).Value = "A"
Cells(3, 5).FormulaR1C1 = "=CONCATENATE(r[-1]c,r[-2]c)"
a1 = "A2"
a2 = Cells(3, 5).Value
Cells(1, 5).Value = a1
Cells(2, 5).Value = a2
Cells(3, 5).Value = ":"
Cells(4, 5).FormulaR1C1 = "=CONCATENATE(r[-3]c,r[-1]c,r[-2]c)"
plage = Cells(4, 5).Value
Range("E1:E4").Delete
For i = 2 To Sheets.Count
Worksheets(i).Activate
Range(plage).Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Next i
End Sub |