Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Option Explicit
Sub Rng_Snapshot()
 Dim rng As Range
 
 Application.ScreenUpdating = False
 
 Set rng = Sheet89.Range("U14:AU61")
 
 rng.CopyPicture
 
 On Error Resume Next
 
 Sheet4.Range("A1").PasteSpecial
 
 Set rng = Nothing
 
 Application.ScreenUpdating = True
 End Sub

I'm using the above code to create a snapshot of a range of cells and paste it into a separate sheet. Is there any way of modifying it so it displays the snapshot as a popup window in front of everything else ?

question from:https://stackoverflow.com/questions/66054234/range-snapshot-as-a-popup-window

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
162 views
Welcome To Ask or Share your Answers For Others

1 Answer

For a quick & dirty solution, you could simply paste the picture somewhere and wait a couple of seconds before deleting it again. (Used bitmap for the opaque background). There's a limit on how big the picture can be though, and it depends what else you have going on on the screen.

Range("D13:AF58").CopyPicture Appearance:=xlScreen, Format:=xlBitmap
ActiveSheet.Paste Destination:=Range("A99")
Selection.ShapeRange.ScaleHeight 0.7, msoFalse, msoScaleFromTopLeft
Range("A99").Show
Application.Wait (Now + TimeValue("0:00:02"))
Selection.Delete
Application.CutCopyMode = False

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...