PC Review


Reply
 
 
Adam H
Guest
Posts: n/a
 
      17th Feb 2009
Hiya,

I need to set up two check boxes in excel.
The first box needs to be there, on show, all the time, but the second only
needs to appear once the first has been ticked.
Is this possible??

Thanks you for taking the time to read and reply to this,

Adam
 
Reply With Quote
 
 
 
 
egun
Guest
Posts: n/a
 
      17th Feb 2009
I added two checkboxes to a worksheet, with default names, in design view.
Right click on CheckBox2 and select Properties. In the Properties window,
select False for the Visible property.

Right click on CheckBox1 and select View Code. In the Click event that is
automatically created, use the following code. It will change the visibility
of CheckBox2 according to the value of CheckBox1.

You could also use the Enabled property for CheckBox2, if you wanted to keep
it visible but didn't want to allow the user to change its value unless
CheckBox1 is True.

Private Sub CheckBox1_Click()
If Me.CheckBox1.Value Then
Me.CheckBox2.Visible = True
Else
Me.CheckBox2.Visible = False
End If
End Sub

HTH,

Eric

 
Reply With Quote
 
Adam H
Guest
Posts: n/a
 
      17th Feb 2009
hiya,

thanks a lot for that but it doent seem to work with the version of excel i
am using, i am using microsoft office excel 2002. do i need to update the
software before being able to do this?? when i right click on the check box,
the only options are cut, copy, paste, edit text, grouping, order, assign
macro, and format control.

Hope this makes it clearer.

Thanks again

"egun" wrote:

> I added two checkboxes to a worksheet, with default names, in design view.
> Right click on CheckBox2 and select Properties. In the Properties window,
> select False for the Visible property.
>
> Right click on CheckBox1 and select View Code. In the Click event that is
> automatically created, use the following code. It will change the visibility
> of CheckBox2 according to the value of CheckBox1.
>
> You could also use the Enabled property for CheckBox2, if you wanted to keep
> it visible but didn't want to allow the user to change its value unless
> CheckBox1 is True.
>
> Private Sub CheckBox1_Click()
> If Me.CheckBox1.Value Then
> Me.CheckBox2.Visible = True
> Else
> Me.CheckBox2.Visible = False
> End If
> End Sub
>
> HTH,
>
> Eric
>

 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      17th Feb 2009
That's because you're using check box objects from the Forms control
bar, not the Controls command bar. Put the following code in a module
and change the names of the check boxes accordingly. Assign the macro
to the check box.

Sub ChkClick()
Dim Chk1 As Excel.CheckBox
Dim Chk2 As Excel.CheckBox
Set Chk1 = Worksheets("Sheet1").CheckBoxes("Check Box 1")
Set Chk2 = Worksheets("Sheet1").CheckBoxes("Check Box 2")
If Chk1.Value = 1 Then
Chk2.Visible = True
Else
Chk2.Visible = False
End If
End Sub

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Tue, 17 Feb 2009 08:46:00 -0800, Adam H
<(E-Mail Removed)> wrote:

>hiya,
>
>thanks a lot for that but it doent seem to work with the version of excel i
>am using, i am using microsoft office excel 2002. do i need to update the
>software before being able to do this?? when i right click on the check box,
>the only options are cut, copy, paste, edit text, grouping, order, assign
>macro, and format control.
>
>Hope this makes it clearer.
>
>Thanks again
>
>"egun" wrote:
>
>> I added two checkboxes to a worksheet, with default names, in design view.
>> Right click on CheckBox2 and select Properties. In the Properties window,
>> select False for the Visible property.
>>
>> Right click on CheckBox1 and select View Code. In the Click event that is
>> automatically created, use the following code. It will change the visibility
>> of CheckBox2 according to the value of CheckBox1.
>>
>> You could also use the Enabled property for CheckBox2, if you wanted to keep
>> it visible but didn't want to allow the user to change its value unless
>> CheckBox1 is True.
>>
>> Private Sub CheckBox1_Click()
>> If Me.CheckBox1.Value Then
>> Me.CheckBox2.Visible = True
>> Else
>> Me.CheckBox2.Visible = False
>> End If
>> End Sub
>>
>> HTH,
>>
>> Eric
>>

 
Reply With Quote
 
egun
Guest
Posts: n/a
 
      17th Feb 2009
Make sure you are in design mode before you right click. To do that, first
you have to show the Visual Basic toolbar (right click somewhere in the
toolbar area at the top of the window). Then click on the "right angle" icon
- Design Mode. Then when you right click on the check box, you should see
the "View Code" and "Properties" items in the menu.

When you're done, click the Design Mode icon to get out of design mode.

Eric

"Adam H" wrote:

> hiya,
>
> thanks a lot for that but it doent seem to work with the version of excel i
> am using, i am using microsoft office excel 2002. do i need to update the
> software before being able to do this?? when i right click on the check box,
> the only options are cut, copy, paste, edit text, grouping, order, assign
> macro, and format control.
>
> Hope this makes it clearer.
>
> Thanks again
>
> "egun" wrote:
>
> > I added two checkboxes to a worksheet, with default names, in design view.
> > Right click on CheckBox2 and select Properties. In the Properties window,
> > select False for the Visible property.
> >
> > Right click on CheckBox1 and select View Code. In the Click event that is
> > automatically created, use the following code. It will change the visibility
> > of CheckBox2 according to the value of CheckBox1.
> >
> > You could also use the Enabled property for CheckBox2, if you wanted to keep
> > it visible but didn't want to allow the user to change its value unless
> > CheckBox1 is True.
> >
> > Private Sub CheckBox1_Click()
> > If Me.CheckBox1.Value Then
> > Me.CheckBox2.Visible = True
> > Else
> > Me.CheckBox2.Visible = False
> > End If
> > End Sub
> >
> > HTH,
> >
> > Eric
> >

 
Reply With Quote
 
Adam H
Guest
Posts: n/a
 
      17th Feb 2009
hello again,
Thank you for the help!! it worked perfectly!!
however, one more little problem, i saved my work and shut down, but when i
went to reopen and use the check box functions, a help box came up saying
that "to run the macros, you can either have them signed or change your
security level." now i changed my security level to low, and this still did
not help,
Any suggestions on how to solve this problem?

Thank you very much.

Adam

"egun" wrote:

> Make sure you are in design mode before you right click. To do that, first
> you have to show the Visual Basic toolbar (right click somewhere in the
> toolbar area at the top of the window). Then click on the "right angle" icon
> - Design Mode. Then when you right click on the check box, you should see
> the "View Code" and "Properties" items in the menu.
>
> When you're done, click the Design Mode icon to get out of design mode.
>
> Eric
>
> "Adam H" wrote:
>
> > hiya,
> >
> > thanks a lot for that but it doent seem to work with the version of excel i
> > am using, i am using microsoft office excel 2002. do i need to update the
> > software before being able to do this?? when i right click on the check box,
> > the only options are cut, copy, paste, edit text, grouping, order, assign
> > macro, and format control.
> >
> > Hope this makes it clearer.
> >
> > Thanks again
> >
> > "egun" wrote:
> >
> > > I added two checkboxes to a worksheet, with default names, in design view.
> > > Right click on CheckBox2 and select Properties. In the Properties window,
> > > select False for the Visible property.
> > >
> > > Right click on CheckBox1 and select View Code. In the Click event that is
> > > automatically created, use the following code. It will change the visibility
> > > of CheckBox2 according to the value of CheckBox1.
> > >
> > > You could also use the Enabled property for CheckBox2, if you wanted to keep
> > > it visible but didn't want to allow the user to change its value unless
> > > CheckBox1 is True.
> > >
> > > Private Sub CheckBox1_Click()
> > > If Me.CheckBox1.Value Then
> > > Me.CheckBox2.Visible = True
> > > Else
> > > Me.CheckBox2.Visible = False
> > > End If
> > > End Sub
> > >
> > > HTH,
> > >
> > > Eric
> > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to restore check boxes changed by gremlin to text boxes? Rumple41 Microsoft Access 8 22nd Dec 2008 06:31 AM
Show check boxes which arn't blank, hide check boxes which are bla Accessorise Microsoft Access Forms 1 12th Jun 2008 08:29 AM
Make check boxes look like radio check boxes? AAaron123 Microsoft VB .NET 2 24th Apr 2008 02:24 AM
Concat unbound text boxes for true check boxes EmAlbritton via AccessMonster.com Microsoft Access Reports 10 1st Nov 2006 04:49 PM
Excel controls (check boxes, text boxes, etc.) not loading =?Utf-8?B?a3N3aW50aA==?= Microsoft Excel Crashes 3 29th Jun 2005 08:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:46 PM.