Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Check Box Question

The easiest way is to make the Command Button intially disabled,
and enable it in the check box's click event:

Private Sub CheckBox1_Click()
Me.CommandButton1.Enabled = Me.CheckBox1.Value
End Sub

However this doesn't give you the message you ask for. You
can do this by:

Private Sub CommandButton1_Click()
If Not Me.CheckBox1.Value Then
MsgBox "Check the box first!"
Exit Sub
End If

MsgBox "All OK"

End Sub


Hope this helps
Andrew

Hazel wrote:
Hi All

I have a userform with several Commandbuttons there is one button that I
would like to control by a Checkbox -- in other words the user would have to
click the Check Box before the Command Button would work - and if the user
clicked on the Command Button 1st a message box would ask the user to click
the Check Box before the Command button will work. For all you experts out
there is that possible??
--
Many thanks

hazel


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
Check box question??? Pas Excel Discussion (Misc queries) 4 March 9th 10 05:41 PM
Check Box Question Ksean Excel Worksheet Functions 5 January 8th 10 02:25 AM
check box question mac Excel Worksheet Functions 3 September 1st 09 12:20 AM
Check box logic question Ailsa02 Excel Worksheet Functions 4 August 23rd 08 04:04 PM
check boxes in Excel - VBA Question [email protected] Excel Programming 1 July 28th 06 06:29 PM


All times are GMT +1. The time now is 10:15 AM.

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"