Change this line in the JPG_Snapshot routine:
to:![]()
MyAddress = SelectArea
for example.![]()
MyAddress = "A1:C5"
Change this line in the JPG_Snapshot routine:
to:![]()
MyAddress = SelectArea
for example.![]()
MyAddress = "A1:C5"
Everyone who confuses correlation and causation ends up dead.
Hi,
Again, fantastic this works perfectly
Is it possible to turn the grid off for the picture only?
Thanks
Turn it off at the start and back on at the end:
![]()
Public Sub JPG_Snapshot() Dim varReturn As Variant Dim MyAddress As String Dim SaveName As Variant Dim MySuggest As String Dim Hi As Integer Dim Wi As Integer Dim wks As Worksheet Set Sourcebook = ActiveWorkbook Activewindow.DisplayGridlines = False Set wks = ActiveSheet Set containerbook = Workbooks.Add(1) containerbook.Sheets(1).Name = "JPGcontainer" MySuggest = sShortname(wks.Name) Set container = CreateContainer(containerbook) Sourcebook.Activate MyAddress = SelectArea If MyAddress <> "A1" Then SaveName = "C:\Users\Stephen\Documents\Marshall\PDD Macro Test " & Format(Date, "m-d-yyyy") & ".jpg" If SaveName <> False Then With wks.Range(MyAddress) .CopyPicture Appearance:=xlScreen, Format:=xlBitmap Hi = .Height + 4 'adjustment for gridlines Wi = .Width + 6 'adjustment for gridlines End With MakeAndSizeChart container, ih:=Hi, iv:=Wi With container .Paste .Export Filename:=LCase(SaveName), FilterName:="jpg" .Pictures(1).Delete End With Sourcebook.Activate Activewindow.DisplayGridlines = True End If End If On Error Resume Next Application.StatusBar = False containerbook.Saved = True containerbook.Close End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks