Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Image controled by VB tools

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default Image controled by VB tools

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Image controled by VB tools

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP! Where is the Tools tab?? Donna and very frustrated. Excel Discussion (Misc queries) 2 December 29th 08 11:43 AM
Automatically adding image extension ".jpg" to end of image name Alain Excel Discussion (Misc queries) 3 June 19th 08 03:21 PM
can font color be controled in an IF statement Confused Rookie Excel Worksheet Functions 3 November 21st 07 05:25 PM
Transfering one image to another image LT Excel Discussion (Misc queries) 0 April 27th 07 06:55 PM
Hyperlink to an image in other worksheet, displaying entire image. twilliams Excel Worksheet Functions 0 February 7th 06 10:02 PM


All times are GMT +1. The time now is 05:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"