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
| Sub PowerActivities()
act = Worksheets("Data Power").Cells(3, 2).Value
If act = 1 Then Exit Sub Else
'CCO
For Column = 5 To 7
For Row1 = 47 To 76
Select Case Column
Case 5
Worksheets("Data Act").Cells(Row1, (act - 2) * 3 + Column).Copy
Worksheets("Power Summary").Cells(Row1 - 34, 4).PasteSpecial (xlPasteValues)
Case 6
Worksheets("Data Act").Cells(Row1, (act - 2) * 3 + Column).Copy
Worksheets("Power Summary").Cells(Row1 - 34, 8).PasteSpecial (xlPasteValues)
Case 7
Worksheets("Data Act").Cells(Row1, (act - 2) * 3 + Column).Copy
Worksheets("Power Summary").Cells(Row1 - 34, 12).PasteSpecial (xlPasteValues)
End Select
Next Row1
Next Column
'Conso
For Column = 5 To 7
For Row2 = 12 To 41
Select Case Column
Case 5
Worksheets("Data Act").Cells(Row2, (act - 2) * 3 + Column).Copy
Worksheets("Power Summary").Cells(Row2 + 1, 16).PasteSpecial (xlPasteValues)
Case 6
Worksheets("Data Act").Cells(Row2, (act - 2) * 3 + Column).Copy
Worksheets("Power Summary").Cells(Row2 + 1, 20).PasteSpecial (xlPasteValues)
Case 7
Worksheets("Data Act").Cells(Row2, (act - 2) * 3 + Column).Copy
Worksheets("Power Summary").Cells(Row2 + 1, 24).PasteSpecial (xlPasteValues)
End Select
Next Row2
Next Column
End Sub
Sub Geography()
Geo = Worksheets("Data Power").Cells(7, 2).Value
Row = Geo + 2164
If Geo = 0 Then Exit Sub Else
For A = Row To Row + 30
Call PowerActivities
Next A
End Sub |
Partager