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
| Private Sub Impression_graphique_annuel()
'Imprime tous les graphiques sur la base du tableau "SYN" _
Pour les économies de papier, n'oubliez pas de mettre PDF Creator _
en imprimante par défaut !
Dim Sh As Worksheet
Dim Ch As Chart
Dim UniS As Variant
Dim Zone As Range
Dim i As Integer
Set Sh = ThisWorkbook.Worksheets("SYN")
Set Ch = ThisWorkbook.Charts.Add
For i = 2 To 8 Step 1
UniS = Sh.Range("A" & i).Value
If UniS Is Nothing Then
MsgBox vbTab & vbTab & vbTab & vbTab & vbTab & "Un problème est survenu." & vbNewLine & _
"Si vous ne savez pas résoudre le problème, reprenez une version antérieur d'ADAL dans le Dossier Archivage"
Else
If UniS.Value = "Chocolat" Or _
"Bonbons" Or _
"Gâteaux" Or _
"Biscuits" Then
Set Zone = Sh.Range("9:9")
Else
Set Zone = Sh.Range("10:10")
End If
With Ch
.ChartType = xlXYScatterSmooth
.SetSourceData Source:=Union(Sh.Range("1:1"), Sh.Rows(UniS.Row), Zone)
With .Axes(xlCategory)
.HasTitle = True
.AxisTitle.Characters.Text = "Semaines"
.MinimumScale = 1
.MaximumScale = 3
End With
With .Axes(xlValue)
.HasTitle = True
.AxisTitle.Characters.Text = "Notes"
.MinimumScale = 0
.MaximumScale = 1
.TickLabels.NumberFormat = "0%"
End With
.HasLegend = True
.HasTitle = True
.ChartTitle.Text = "Audits" 'Ajoutez l'année (Ex: "Audits Rangement-Propreté 2012")
With ActiveSheet
.PageSetup.LeftMargin = Application.InchesToPoints(0.25)
.PageSetup.RightMargin = Application.InchesToPoints(0.25)
.PageSetup.TopMargin = Application.InchesToPoints(0.25)
.PageSetup.BottomMargin = Application.InchesToPoints(0.25)
.PageSetup.CenterHorizontally = True
.PageSetup.CenterVertically = True
.PageSetup.FitToPagesWide = 1
.PageSetup.FitToPagesTall = 1
.PrintOut
.Delete
End With
End With
End If
Next i
Set Ch = Nothing
Set Zone = Nothing
Set UniS = Nothing
Set Sh = Nothing
End Sub |
Partager