- Katılım
- 6 Temmuz 2021
- Mesajlar
- 8
- Excel Vers. ve Dili
- excel professional plus 2013
Bu makro Exceldeki seçili alanı jpg olarak kaydediyor ama resmin boyutu küçük çıkıyor grafik alanı büyüse foto orjinale yakın çıkabilir diye düşündüm ama grafiğin alanını büyütemedim yardımcı olabilirmisiniz
Option Explicit
Private Sub SaveRngAsJPG(Rng As Range, FileName As String)
Dim Cht As Chart, bScreen As Boolean, Shp As Shape
bScreen = Application.ScreenUpdating
Application.ScreenUpdating = False
Set Cht = Workbooks.Add(xlChart).Charts(1)
Cht.ChartArea.Clear
Rng.CopyPicture xlScreen, xlPicture
Cht.Paste
With Cht.Shapes(1)
.Left = -500
.Top = -500
.Width = Cht.ChartArea.Width
.Height = Cht.ChartArea.Height
End With
Cht.Export FileName, "JPEG", False
Cht.Parent.Close False
Application.ScreenUpdating = bScreen
End Sub
Sub TestIt2()
Dim Rng As Range, Fn As String
Set Rng = Range("A1:AD55")
Fn = "C:\Users\TBG\OneDrive\Masaüstü\4ExcelSayfam.jpg"
SaveRngAsJPG Rng, Fn
End Sub
Option Explicit
Private Sub SaveRngAsJPG(Rng As Range, FileName As String)
Dim Cht As Chart, bScreen As Boolean, Shp As Shape
bScreen = Application.ScreenUpdating
Application.ScreenUpdating = False
Set Cht = Workbooks.Add(xlChart).Charts(1)
Cht.ChartArea.Clear
Rng.CopyPicture xlScreen, xlPicture
Cht.Paste
With Cht.Shapes(1)
.Left = -500
.Top = -500
.Width = Cht.ChartArea.Width
.Height = Cht.ChartArea.Height
End With
Cht.Export FileName, "JPEG", False
Cht.Parent.Close False
Application.ScreenUpdating = bScreen
End Sub
Sub TestIt2()
Dim Rng As Range, Fn As String
Set Rng = Range("A1:AD55")
Fn = "C:\Users\TBG\OneDrive\Masaüstü\4ExcelSayfam.jpg"
SaveRngAsJPG Rng, Fn
End Sub