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
|
Sub Mise_a_jour_donnees()
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Dim RowHB2 As Long, Row2012 As Long, Row2013 As Long, Row2014 As Long
RowHB2 = 4
Row2012 = 2
Row2013 = 2
Row2014 = 2
While Sheets("Hall B2").Cells(RowHB2, 1).Value <> ""
If Year(Sheets("Hall B2").Cells(RowHB2, 1)) = "2012" Then
Sheets("Hall B2").Cells(RowHB2, 1).EntireRow.Copy Sheets("Données 2012").Cells(Row2012, 1).EntireRow
Sheets("Données 2012").Cells(Row2012, 19).FormulaR1C1 = "=WEEKNUM(RC[-12])"
Sheets("Données 2012").Cells(Row2012, 20).Value = Month(Sheets("Données 2012").Cells(Row2012, 1))
RowHB2 = RowHB2 + 1
Row2012 = Row2012 + 1
Else
If Year(Sheets("Hall B2").Cells(RowHB2, 1)) = "2013" Then
Sheets("Hall B2").Cells(RowHB2, 1).EntireRow.Copy Sheets("Données 2013").Cells(Row2013, 1).EntireRow
Sheets("Données 2013").Cells(Row2013, 19).FormulaR1C1 = "=WEEKNUM(RC[-12])"
Sheets("Données 2013").Cells(Row2013, 20).Value = Month(Sheets("Données 2013").Cells(Row2013, 1))
RowHB2 = RowHB2 + 1
Row2013 = Row2013 + 1
Else
If Year(Sheets("Hall B2").Cells(RowHB2, 1)) = "2014" Then
Sheets("Hall B2").Cells(RowHB2, 1).EntireRow.Copy Sheets("Données 2014").Cells(Row2014, 1).EntireRow
Sheets("Données 2014").Cells(Row2014, 19).FormulaR1C1 = "=WEEKNUM(RC[-12])"
Sheets("Données 2014").Cells(Row2014, 20).Value = Month(Sheets("Données 2014").Cells(Row2014, 1))
RowHB2 = RowHB2 + 1
Row2014 = Row2014 + 1
Else
RowHB2 = RowHB2 + 1
End If
End If
End If
Wend
Sheets("Données 2012").Columns("S:T").Style = "Comma"
Sheets("Données 2012").Columns("S:T").NumberFormat = "_-* #,##0 __-;-* #,##0 __-;_-* ""-""?? __-;_-@_-"
Sheets("Données 2013").Columns("S:T").Style = "Comma"
Sheets("Données 2013").Columns("S:T").NumberFormat = "_-* #,##0 __-;-* #,##0 __-;_-* ""-""?? __-;_-@_-"
Sheets("Données 2014").Columns("S:T").Style = "Comma"
Sheets("Données 2014").Columns("S:T").NumberFormat = "_-* #,##0 __-;-* #,##0 __-;_-* ""-""?? __-;_-@_-"
'Sheets("TCD T° Mois 2014 (MIC)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD T° Semaine 2014 (MIC)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD H% Mois 2014 (MIC)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD H% Semaine 2014 (MIC)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD T° Mois 2014 (EXT)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD T° Semaine 2014 (EXT)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD T° Mois 2014 (MAG)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD T° Semaine 2014 (MAG)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD H% Mois 2014 (MAG)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD H% Semaine 2014 (MAG)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD T° Mois 2014 (ENC)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD T° Semaine 2014 (ENC)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD H% Mois 2014 (ENC)").PivotTables("TCD1").PivotCache.Refresh
'Sheets("TCD H% Semaine 2014 (ENC)").PivotTables("TCD1").PivotCache.Refresh
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub |
Partager