ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Making a camera picture appear/disappear (https://www.excelbanter.com/excel-programming/396834-making-camera-picture-appear-disappear.html)

Bob

Making a camera picture appear/disappear
 
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.


NC

Making a camera picture appear/disappear
 
On Sep 4, 9:32 pm, Bob wrote:
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






JE McGimpsey

Making a camera picture appear/disappear
 
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


In article . com,
NC wrote:

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


Bob

Making a camera picture appear/disappear
 
NC,

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

Bob


"NC" wrote:

On Sep 4, 9:32 pm, Bob wrote:
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







Bob

Making a camera picture appear/disappear
 
JE,

Thanks for the code modification. I really appreciate it!

Bob


"JE McGimpsey" wrote:

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


In article . com,
NC wrote:

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




All times are GMT +1. The time now is 03:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com