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
|
Dim wSy As Excel.Workbook 'objet classeur synthese simm rc mob
Dim shSy As Excel.Sheets
Dim sSy As Excel.Worksheet
Dim rSy As Excel.Range
Dim ligne_cibleMob As Integer
Dim ligne_cibleRc As Integer
Dim colonne_jour As Integer
Dim TabMoisOnglet(1 To 12) As String
Dim i As Integer
TabMoisOnglet(1) = "Janvier 2009"
TabMoisOnglet(2) = "Février 2009"
TabMoisOnglet(3) = "Mars 2009"
TabMoisOnglet(4) = "Avril 2009"
TabMoisOnglet(5) = "Mai 2009"
TabMoisOnglet(6) = "Juin 2009"
TabMoisOnglet(7) = "Juillet 2009"
TabMoisOnglet(8) = "Aout 2009"
TabMoisOnglet(9) = "Septembre 2009"
TabMoisOnglet(10) = "Octobre 2009"
TabMoisOnglet(11) = "Novembre 2009"
TabMoisOnglet(12) = "Décembre 2009"
Set wSy = Application.Workbooks.Open(synthesesimm_file)
Set shSy = wSy.Sheets
'recherche de l'onglet du mois et init des objets
i = 0
Do While i < shSy.Count
i = i + 1
If TabMoisOnglet(MoisInt) = wSy.Worksheets(i).Name Then
Set sSy = wSy.Worksheets(i)
Set rSy = sSy.Range("A1:Z100")
i = shSy.Count
End If
Loop
'recherche des lignes rc et mob à compléter
ligne_cibleRc = "1"
colonne_jour = "2"
Do Until rSy(ligne_cibleRc, colonne_jour).Value = JourInt
ligne_cibleRc = ligne_cibleRc + 1
Loop
ligne_cibleMob = ligne_cibleRc + 1
Do Until rSy(ligne_cibleMob, colonne_jour).Value = JourInt
ligne_cibleMob = ligne_cibleMob + 1
Loop
'copie des variables
rSy(ligne_cibleRc, 6).Value = Prod_moy_realisee_simm_rc
rSy(ligne_cibleRc, 7).Value = Prod_moy_prevue_simm_rc
rSy(ligne_cibleRc, 3).Value = Tps_log_realise_simm_rc
rSy(ligne_cibleRc, 3).NumberFormatLocal = "[h]:mm:ss"
rSy(ligne_cibleRc, 4).Value = Tps_log_prevu_simm_rc
rSy(ligne_cibleRc, 4).NumberFormatLocal = "[h]:mm:ss"
rSy(ligne_cibleMob, 6).Value = Prod_moy_realisee_simm_mob
rSy(ligne_cibleMob, 7).Value = Prod_moy_prevue_simm_mob
rSy(ligne_cibleMob, 3).Value = Tps_log_realise_simm_mob
rSy(ligne_cibleMob, 3).NumberFormatLocal = "[h]:mm:ss"
rSy(ligne_cibleMob, 4).Value = Tps_log_prevu_simm_mob
rSy(ligne_cibleMob, 4).NumberFormatLocal = "[h]:mm:ss"
wSy.Close True
Set wSy = Nothing
Set shSy = Nothing
Set sSy = Nothing
Set rSy = Nothing
End Sub |
Partager