Making a camera picture appear/disappear

B

Bob

On a hidden worksheet I have a range of cells containing the Assumptions
utilized throughout the rest of the workbook. Using Excel's camera tool, I
have taken a "picture" of the range and placed it on the hidden worksheet as
well.

On the other, non-hidden worksheets, I would like to have a button that,
when clicked, would display a small "pop-up" window containing the "picture".

Is there a way in VBA that this can be done? Any help would be greatly
appreciated. Thanks.
 
N

NC

On a hidden worksheet I have a range of cells containing the Assumptions
utilized throughout the rest of the workbook. Using Excel's camera tool, I
have taken a "picture" of the range and placed it on the hidden worksheet as
well.

On the other, non-hidden worksheets, I would like to have a button that,
when clicked, would display a small "pop-up" window containing the "picture".

Is there a way in VBA that this can be done? Any help would be greatly
appreciated. Thanks.

Hi,
There is no need of having a hidden worksheet.
You record a macro while taking the picture of your range
you will get the reference name of the picture taken... like "Picture
1" etc.
Then you can easily set the property of this picture to visible =true
or false at the click of button.


Hope this helps.

The sample code is as below.

Sub Macro1()

Range("C8:F16").Select
Selection.Copy
Range("D5").Select
ActiveSheet.Pictures.Paste(Link:=True).Select
Range("J11").Select
ActiveSheet.Shapes("Picture 1").Select
Application.CutCopyMode = False
End Sub

Sub macro2()
'Hide Picture
ActiveSheet.Shapes("Picture 1").Visible = False
End Sub

Sub macro3()
'Make picture visible
ActiveSheet.Shapes("Picture 1").Visible = True
End Sub
 
J

JE McGimpsey

As an option, you can also use a single macro as a toggle:

Public Sub TogglePicture1()
With ActiveSheet.Shapes("Picture 1")
.Visible = Not .Visible
End With
End Sub
 
B

Bob

NC,

Thanks for the suggestion and the accompanying code. I really appreciate it!

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top