View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Refeencing a check box on an Excel sheet

Depends where you got the check box from. If it came from the control toolbox
then your code should work (you may need to reference the worksheet irf you
are trying to access the checbox from code anywhere other than the sheet that
has the checkbox. If the check box came from the forms toolbar then you need
fairly different code. Give this a try... It was created by starting with a
brand new work book and placing a control from both the forms toolbar and the
control toolbox on sheet 1...

Sub Test
MsgBox Sheet1.CheckBox1.Value 'control toolbox
'Forms Toolbar
MsgBox Sheet1.Shapes("Check Box 1").ControlFormat.Value < xlOff
End Sub

--
HTH...

Jim Thomlinson


"jayklmno" wrote:

I have added a check box control to a sheet in Excel and am trying to check
that box for it's true/false value. How do I find out the name of the
control? I see Excel named it Check Box 95, but I can't get it to refernce
the value...

if checkbox95 = true then...

doesn't work, or when I refernce the sheet directly. What is the correct
syntax for this..

Thanks!