Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / October 2004

Tip: Looking for answers? Try searching our database.

Using Checkboxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mischa - 18 Oct 2004 09:35 GMT
Good day,

I have a commandbutton placed in my workbook.

If you press the button sub MyDozen will be called.

Now I want this commandbutton to have two functions.

So either sub MyDozen is called or sub MyBoots is called.

I have placed a checkbox next to the button.

So if the user wants to call the standard sub (MyDozen) than the checkbox
should be un-checked.

If the user wants to call the second sub (MyBoots) is called he should
select the checkbox.

Now what code should I write behind the commanbutton to check if the
checkbox is selected?

Tks,

mischa
- 18 Oct 2004 16:34 GMT
Why make life so complicated! Have two commandbuttons and
assign the macros seperately. Cheers.

>-----Original Message-----
>Good day,
[quoted text clipped - 23 lines]
>
>.
Dave Peterson - 19 Oct 2004 00:31 GMT
The commandbutton is from the control toolbox toolbar placed on a worksheet?

If yes, then I put this under that worksheet:

Option Explicit
Private Sub CommandButton1_Click()
   
   If Me.CheckBox1.Value = True Then
       Call MyBoots
   Else
       Call MyDozen
   End If

End Sub

And these in a general module.

Option Explicit
Sub MyBoots()
   MsgBox "from MyBoots"
End Sub
Sub MyDozen()
   MsgBox "from myDozen"
End Sub

> Good day,
>
[quoted text clipped - 20 lines]
>
> mischa

Signature

Dave Peterson
ec35720@msn.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.