Dim ss As Long
Path = CreateObject("WScript.Shell").SpecialFolders("Desktop") & "\" & "Capture2.jpg"
'لو عايز تغيير مكان الحفظ تقدر تغييره مكان كلمة desktop ولو عايز تغيير الاسم تقدر تغيير capture2
ss = Cells(235, 7).End(xlUp).Row ' ss دي عملتها عشان اخر سطر فيه بيانات
'celles(235,7) انا هنا حددت اخر سطر هيبحث من عنده لفوق و اخترت 7 عشان ياخد من اخر سطر في بينات العموم رقم 7
Set Rng = Sheets("اسم صفحة العمل").Range("e171:g" & ss) 'e171:g ده النطاق اللي عايز يتاخد ليه سكرين شوت
' اما باقي الكود مش فاكر والله كنت جايبه منين تقريبا من موقع اجنبي
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)
Application.DisplayAlerts = False
.Delete
Application.DisplayAlerts = True
End With
MsgBox "Saved to " & vbCr & Path, vbInformation, ""