I copied a code given in a different thread and modified it to fit my file. But now, I'm using MacOS.
I don't know how to change this Path = CreateObject("WScript.Shell").SpecialFolders("Desktop") & "\" & "Capture.jpg"
for MacOS.
The code allows me to copy a range in an excel file then paste the copied range as a photo in a separate sheet. Then export or save it as "Capture.jpg" in Windows Desktop.
Dim aChart As Chart, Rng As Range, Path As String
Path = CreateObject("WScript.Shell").SpecialFolders("Desktop") & "\" & "Capture.jpg"
Set Rng = Range("E1:F54")
Call Rng.CopyPicture(xlScreen, xlPicture)
With Sheets.Add
.Shapes.AddChart
.Activate
.Shapes.Item(1).Select
Set aChart = ActiveChart
.Shapes.Item(1).Line.Visible = msoFalse
.Shapes.Item(1).Width = Rng.Width
.Shapes.Item(1).Height = Rng.Height
aChart.Paste
aChart.Export (Path)
Rng.CopyPicture
Application.DisplayAlerts = False
.Delete
Application.DisplayAlerts = True
End With