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
| Function cellule_tout_vide(Plage As Range) As Boolean
Dim vCellule As Object
cellule_tout_vide = True
For Each vCellule In Plage
If vCellule <> "" Then
cellule_tout_vide = False
End If
Next
End Function
Function Refraichir_Graph_BB()
cel = "A36"
DerniereLigne = Range(cel).CurrentRegion.End(xlDown).Row
ActiveWorkbook.Worksheets("BB duration").Select
Range("A1").Select
ActiveSheet.ChartObjects("Graphique 7").Activate
If cellule_tout_vide(Range("d36:d" & DerniereLigne & "")) = False Then
ActiveChart.SeriesCollection("DMAIC Duration").Select
ActiveChart.SeriesCollection("DMAIC Duration").Values = "='BB Duration'!R36C4:R" & DerniereLigne & "C4"
End If
If cellule_tout_vide(Range("e20:e" & DerniereLigne & "")) = False Then
ActiveChart.SeriesCollection("Average Duration").Select
ActiveChart.SeriesCollection("Average Duration").Values = "='BB Duration'!R36C5:R" & DerniereLigne & "C5"
End If
If cellule_tout_vide(Range("h20:h" & DerniereLigne & "")) = False Then
ActiveChart.SeriesCollection("UCL").Select
ActiveChart.SeriesCollection("UCL").Values = "='BB Duration'!R36C8:R" & DerniereLigne & "C8"
End If
If cellule_tout_vide(Range("K20:K" & DerniereLigne & "")) = False Then
ActiveChart.SeriesCollection("Target").Select
ActiveChart.SeriesCollection("Target").Values = "='BB Duration'!R36C11:R" & DerniereLigne & "C11"
End If
If cellule_tout_vide(Range("i20:i" & DerniereLigne & "")) = False Then
ActiveChart.SeriesCollection("LCL").Select
ActiveChart.SeriesCollection("LCL").Values = "='BB Duration'!R36C9:R" & DerniereLigne & "C9"
End If
ActiveChart.SeriesCollection(1).XValues = "='BB Duration'!R36C3:R" & DerniereLigne & "C3"
ActiveChart.SeriesCollection(2).XValues = "='BB Duration'!R36C3:R" & DerniereLigne & "C3"
ActiveChart.SeriesCollection(3).XValues = "='BB Duration'!R36C3:R" & DerniereLigne & "C3"
ActiveChart.SeriesCollection(4).XValues = "='BB Duration'!R36C3:R" & DerniereLigne & "C3"
End Function |
Partager