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
|
Sub creation_images()
Dim i As Variant
Dim dept As Variant
Dim nom As Variant
Dim plage As Range
'Sheets("Pivot").Select
'i = 2
'While Cells(i, 1) <> ""
'dept = Cells(i, 1)
'nom = Cells(i, 3)
'Sheets(dept).Select
with Sheets("Pivot")
i = 2
While .Cells(i, 1) <> ""
dept = .Cells(i, 1)
nom = .Cells(i, 3)
end with
With Sheets(dept)
Set plage = .Range("D10:Q389")
plage.CopyPicture
With .ChartObjects.Add(plage.Left, plage.Top, plage.Width, plage.Height).Chart
.Paste
.Export "C:\Users\pchatela\Desktop\Frais Généraux\Dept FGX fichiers détail\" & dept & "\" & nom & ".jpg"
End With
.ChartObjects(.ChartObjects.Count).Delete
End With
'Sheets("Pivot").Select
i = i + 1
doevents
Wend
End Sub |
Partager