Question: I have several charts on one of my sheets (charts) and I only want to export 6 specific charts. When I select a chart and go to the `Layout` tab I see something called `Chart Name` which I assume lets me choose the chart name. I've tried changing the name to "ChartA" for one of the charts. Please help with this simple VBA code.

```
Sub SaveJPGTest()
Chart("ChartA").Export "Z:\specialChart.jpg"
End Sub

```

Answer: 
Copied from: <http://windowssecrets.com/forums/showthread.php/129693-Export-charts-from-Excel-into-any-image-format> with minor adaptation.

```
Sub ChartToJPG()
Dim Chrt As Chart
Application.ScreenUpdating = False
ActiveSheet.ChartObjects("ChartA").Activate
ActiveChart.ChartArea.Copy
Set Chrt = Charts.Add
Chrt.Paste
Chrt.Export Filename:="C:\Users\Maudibe\Desktop\MyChart.jpg", Filtername:="JPG"
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

```

Choose path to suit.
I modified this code for when your chart is in it's own sheet. It also automatically gets the active sheet name, `SheetName`, and uses it as the file name for when you save it similar to above. I also changed `basePath` a bit by putting the "\" in the `Filename`. Enjoy.

```
Sub Save_Chart()
   Dim basePath As String
   basePath = ThisWorkbook.Path
   SheetName = ActiveSheet.Name

   ActiveWorkbook.Sheets(SheetName).Activate
   ActiveSheet.Export Filename:=basePath & "\" & SheetName & ".jpg", Filtername:="JPG"
End Sub

```