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: 
Added `basePath` to save the jpg in the same directory as the excel file. Saved as a PNG because it seems to be better quality and smaller file size than JPG. Not sure if this is the best file format to use though. 

This code sets sheet `charts` and chart `ChartA` active, then saves the active chart.

```
Sub SaveAreaPowerJPGs()
  Dim basePath As String
  basePath = ThisWorkbook.Path & "\"
  ActiveWorkbook.Sheets("charts").Activate

  ActiveSheet.ChartObjects("ChartA").Activate
  ActiveChart.Export Filename:=basePath & "ChartA.jpg", Filtername:="PNG"
End Sub

```
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

```