Would someone please be able to help me integrate the active window view as a variable into the code below?
Effectively, I'm trying to integrate the following logic at the beginning (and later end) of the code:
Thank you so much!
BK
Effectively, I'm trying to integrate the following logic at the beginning (and later end) of the code:
- Store the current view of the active sheet as a variable (i.e. xlPageBreakPreview)
- Change the view to normal view (xlNormalView)
- Run instructions from the code
- Last instruction - reset the view to the original stored variable
Thank you so much!
BK
Code:
Sub PasteAsPicture()
Application.DisplayCommentIndicator = xlNoIndicator
Application.DisplayAlerts = False
Set origSht = ActiveSheet
ActiveSheet.Copy after:=Sheets(Sheets.Count)
Set NewSht = ActiveSheet
For Each cll In Selection.Cells
With cll.Font
If .Color <> 16777215 Then .Color = -16777216
End With
Next
Selection.Copy
Application.GoTo origSht.Range("A1")
ActiveSheet.Pictures.Paste
ActiveSheet.Pictures(ActiveSheet.Pictures.Count).Copy
Application.DisplayAlerts = False: NewSht.Delete: Application.DisplayAlerts = True
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
ActiveSheet.Pictures(ActiveSheet.Pictures.Count).Delete
Application.DisplayAlerts = True
End Sub