Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How do I turn on and off the visibility of an image using a radio button or
check box? My problem is in having VB locate the image. How do I name the image so I may then refernce it in VB? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
With an image in the spreadsheet and the cursor in a cell, turn on the Macro Recorder and select the image, then turn off the recorder and view your code. This will tell you what the object name currently is, then add the following code to the Sheet1 object (or whatever sheet your object is on). This is done in the VBE by double-clicking the sheet name in the top left corner of the screen. Private Sub CheckBox1_Click() If Me.CheckBox1 = True Then ActiveSheet.Shapes("Picture 12").Visible = True Else ActiveSheet.Shapes("Picture 12").Visible = False End If End Sub -- If this helps, please click the Yes button. Cheers, Shane Devenshire "jorlypong" wrote: How do I turn on and off the visibility of an image using a radio button or check box? My problem is in having VB locate the image. How do I name the image so I may then refernce it in VB? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
That was my first thought but the macro never recognized my picture or shape
(code in VB was blank for those actions). When looking at the properties of the worksheet it only shows the worksheet itself and my checkbox; therefore, I can't command it because I don't know the pictures name. Any other ideas? "Shane Devenshire" wrote: Hi, With an image in the spreadsheet and the cursor in a cell, turn on the Macro Recorder and select the image, then turn off the recorder and view your code. This will tell you what the object name currently is, then add the following code to the Sheet1 object (or whatever sheet your object is on). This is done in the VBE by double-clicking the sheet name in the top left corner of the screen. Private Sub CheckBox1_Click() If Me.CheckBox1 = True Then ActiveSheet.Shapes("Picture 12").Visible = True Else ActiveSheet.Shapes("Picture 12").Visible = False End If End Sub -- If this helps, please click the Yes button. Cheers, Shane Devenshire "jorlypong" wrote: How do I turn on and off the visibility of an image using a radio button or check box? My problem is in having VB locate the image. How do I name the image so I may then refernce it in VB? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HELP! Where is the Tools tab?? | Excel Discussion (Misc queries) | |||
Automatically adding image extension ".jpg" to end of image name | Excel Discussion (Misc queries) | |||
can font color be controled in an IF statement | Excel Worksheet Functions | |||
Transfering one image to another image | Excel Discussion (Misc queries) | |||
Hyperlink to an image in other worksheet, displaying entire image. | Excel Worksheet Functions |