Hi,
Select a range and export in a folder on desktop
folder's name: RngAsPic
if you select the range A1:D5
file's name is: rng-A1D5
Add the below vba
in a regular module .....
'=================
Sub RangeAsPicture_Desktop()
' ## 27-01-2024 ##
Dim ws As Worksheet
Dim rng As Range
Dim sMain As String, sFd As String, sPath As String, rpl As String
sMain = CreateObject("WScript.Shell").SpecialFolders("Desktop") & ""
sFd = "RngAsPic" & ""
sPath = sMain & sFd
If Dir(sMain & sFd, vbDirectory) = Empty Then MkDir sPath
Set rng = Selection
If MsgBox("select a range ?", vbOKCancel) = vbCancel Then Exit Sub
Application.ScreenUpdating = False
Set ws = Worksheets.Add
Charts.Add
ActiveChart.Location Where:=xlLocationAsObject, Name:=ws.Name
With ActiveChart
With .Parent
.Height = rng.Height
.Width = rng.Width
End With
rng.CopyPicture xlScreen, xlPicture
.Paste
rpl = Replace(rng.Address, "$", "")
rpl = Replace(rpl, ":", "")
.Export Filename:=sPath & "rng-" & rpl & ".png", FilterName:="png"
End With
Application.DisplayAlerts = False
ws.Delete
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub