Thread: checkbox
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
antonov antonov is offline
external usenet poster
 
Posts: 17
Default checkbox

Hello Norman,
first of all thanks for your patience....

I've applied

Sub ClearTextBoxes()
ActiveSheet.CheckBoxes = xlOff
End Sub

but the reply is:

"Run-time error '1004' Unable to set the_Default property of the checkboxes
class"

Now the box in cell H25 becames black as all the inputs I do go together.



"Norman Jones" wrote in message
...
Hi Antonov,

Perhaps I was insufficiently explicit.

I gave :

ActiveSheet.CheckBoxes = xlOff


as a method of clearing all the textboxes in one fell swoop. To use this
instruction it must be included in a procedure. For example, put the
following sub in a normal module and run it:

Sub ClearTextBoxes()
ActiveSheet.CheckBoxes = xlOff
End Sub

If, however, your intention is to clear these textboxes when running the
Userform, then you could add an appropriate instruction to the Userforms
initialize event. e.g.:


Private Sub UserForm_Initialize()
Sheets("Sheet1").CheckBoxes = xlOff

End Sub

When I check the checkbox the answer in H25 = true but the checkbox
doesn't seem to work....


Have you linked the checkbox to the H25 cell?

If not:

Right-click the checkbox | Select the Control tab | type H25 in the Cell
Link box.


---
Regards,
Norman



"antonov" wrote in message
.. .
Hello Norman,
I've tried what you sent me.
When I launch the userform I get the first error with the first part of
the formula:
ActiveSheet.CheckBoxes = xlOff (invalid outside procedure)

When I check the checkbox the answer in H25 = true but the checkbox
doesn't seem to work....

I know I must be doing something wrong....
"Norman Jones" wrote in message
...
Hi Antonov.

Assume that checkboxes are on Sheet1 and that the are fromthe Forms
toolbar.

(1) Try:

ActiveSheet.CheckBoxes = xlOff

(2)

In the Userform's CheckBox Click event, try something like:

Private Sub CheckBox1_Click()

Sheets("Sheet1").Range("H25").Value = _
Me.CheckBox1.Value
End Sub

---
Regards,
Norman



"antonov" wrote in message
.. .
I have 2 problems with checkboxes:

1. in exel 2003 it it possible to clear the text in the checkboxes I've
placed in my workbook?

2. I have a checkbox in an userform. When I checkit I would like the
result to appear in one of the checkboxes in my workbook. How can I do
that? Checkbox1 is over cell H25.....

Thanks