Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MD MD is offline
external usenet poster
 
Posts: 10
Default CheckBox in userform

I'm building a UserForm that has CheckBoxes (called say CB1). The code that
I want to inclued is when CB1 is chcked do this else do that. My start off
bub looks klike this.... but it doesn't work!!!!

Private Sub Bouton_print_Click()

If CB1.Value = True Then
'.... do this
Else
'.... do that
End If
End Sub


Reagrds,

MD



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default CheckBox in userform

Hi MD

This is working for me with a button with the name "CommandButton1"
and a checkbox with the name "Cb1"

Private Sub CommandButton1_Click()
If Me.Cb1.Value = True Then
MsgBox ".... do this"
Else
MsgBox ".... do that"
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"MD" wrote in message ...
I'm building a UserForm that has CheckBoxes (called say CB1). The code that I want to inclued is when CB1 is chcked do this else
do that. My start off bub looks klike this.... but it doesn't work!!!!

Private Sub Bouton_print_Click()

If CB1.Value = True Then
'.... do this
Else
'.... do that
End If
End Sub


Reagrds,

MD





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default CheckBox in userform

Are you sure the button is called Bouton_print?

This is a simpler version of your code that works

Private Sub Bouton_print_Click()
MsgBox IIf(CB1, "Do this", "Do that")
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"MD" wrote in message
...
I'm building a UserForm that has CheckBoxes (called say CB1). The code

that
I want to inclued is when CB1 is chcked do this else do that. My start

off
bub looks klike this.... but it doesn't work!!!!

Private Sub Bouton_print_Click()

If CB1.Value = True Then
'.... do this
Else
'.... do that
End If
End Sub


Reagrds,

MD





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
CheckBox on UserForm Michel[_4_] Excel Programming 0 August 3rd 04 12:38 AM
userform CheckBox print dok112[_12_] Excel Programming 1 June 21st 04 02:50 PM
userform CheckBox print dok112[_11_] Excel Programming 0 June 21st 04 08:41 AM
Userform and checkbox.... Ben.c Excel Programming 3 December 19th 03 05:56 PM
Conditional Checkbox Creation on a UserForm Todd Huttenstine[_2_] Excel Programming 1 November 21st 03 03:38 PM


All times are GMT +1. The time now is 04:23 PM.

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"