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
| Sub export_hiver_jpg()
'
' export_hiver_jpg Macro
''1 Nommer les plages à sélectionner
'Par mapeh
Dim NomPlage, NomFich
Dim LeGraph As Object
Dim Rep As String
Dim i As Byte
Application.ScreenUpdating = False
Rep = "G:\sites web\locweb\images\" 'Répertoire de sauvegarde
NomPlage = Array("tarifrdcpleneyhiver", "tarifduplexnyonhiver", "tarifduplexavoriazhiver", "tarifchaletarthurhiver", "tarifchaletlenidhiver", "tarifarthursaisonhiver") 'Nom de tes plages
NomFich = Array("tarifrdcpleneyhiver", "tarifduplexnyonhiver", "tarifduplexavoriazhiver", "tarifchaletarthurhiver", "tarifnidhiver", "tarifarthursaisonhiver") 'Nom des fichiers de sortie correspondants
' "tarifrdcpleneyhiver", "tarifduplexnyonhiver", "tarifduplexavoriazhiver", "tarifchaletarthurhiver", "tarifchaletlenidhiver"
' "tarifrdcpleneyete", "tarifduplexnyonete", "tarifduplexavoriazete", "tarifchaletarthurete", "tarifchaletlenidete"
With Sheets("HIVER") 'nom de la feuille ou sont les plages
For i = LBound(NomPlage) To UBound(NomPlage)
.Range(NomPlage(i)).CopyPicture
Set LeGraph = .ChartObjects.Add(0, 0, .Range(NomPlage(i)).Width, .Range(NomPlage(i)).Height)
LeGraph.Chart.Paste
LeGraph.Chart.Export Filename:=Rep & NomFich(i) & ".jpg"
LeGraph.Delete
Next i
End With
'
End Sub |
Partager