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
| Private Sub DataGraphic(ByVal cell As String, ByVal result As Integer)
Dim graphic As Chart
Dim sheet As Excel.Worksheet
Dim objShape As InlineShape
For Each objShape In ActiveDocument.InlineShapes
If objShape.HasChart Then
If objShape.Title = "Carto_risques" Then Set graphic = objShape.Chart
End If
Next
graphic.ChartData.Activate
Set sheet = graphic.ChartData.Workbook.Worksheets(1)
sheet.Application.WindowState = xlMinimised
sheet.Range(cell) = result
graphic.Refresh
sheet.Application.Quit
End Sub
Sub R1R1_Click()
cell = "B2"
result = 1
DataGraphic cell, result
End Sub
Sub R1R2_Click()
cell = "B2"
result = 2
DataGraphic cell, result
End Sub
Sub R1R3_Click()
cell = "B2"
result = 3
DataGraphic cell, result
End Sub
Sub R1R4_Click()
cell = "B2"
result = 4
DataGraphic cell, result
End Sub
Sub R1P1_Click()
cell = "C2"
result = 1
DataGraphic cell, result
End Sub
Sub R1P2_Click()
cell = "C2"
result = 2
DataGraphic cell, result
End Sub
Sub R1P3_Click()
cell = "C2"
result = 3
DataGraphic cell, result
End Sub
Sub R1P4_Click()
cell = "C2"
result = 4
DataGraphic cell, result
End Sub |
Partager