Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Setting a CheckBox Value to False

Hi: I'd like to set a checkbox value to false after selection of an item
from a Combo Box. I've tried various things, but cannot seem to get the
correct syntax. Both the Combo Box and Check Box are on a User Form. The
latest code tried is:

Private Sub cmbMembers_Change()
If Val(cmbMembers.Value) 0 Then
Cells(cmbMembers.Value, 1).Select
CheckBox1.Enabled = True: Value = False
Else
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
End If
End Sub

Any help will be appreciated...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Setting a CheckBox Value to False

Hi

You must use the value property of the checkbox

CheckBox1.Value = False

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


"The Hawk" wrote in message ...
Hi: I'd like to set a checkbox value to false after selection of an item
from a Combo Box. I've tried various things, but cannot seem to get the
correct syntax. Both the Combo Box and Check Box are on a User Form. The
latest code tried is:

Private Sub cmbMembers_Change()
If Val(cmbMembers.Value) 0 Then
Cells(cmbMembers.Value, 1).Select
CheckBox1.Enabled = True: Value = False
Else
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
End If
End Sub

Any help will be appreciated...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Setting a CheckBox Value to False

Folks: I figured it out. Here's the final code:
Private Sub cmbMembers_Change()
If Val(cmbMembers.Value) 0 Then
Cells(cmbMembers.Value, 1).Select
CheckBox1.Enabled = True
CheckBox1.Value = Cells(cmbMembers.Value, 4)
Else
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
End If
End Sub

Thanks...

"The Hawk" wrote:

Hi: I'd like to set a checkbox value to false after selection of an item
from a Combo Box. I've tried various things, but cannot seem to get the
correct syntax. Both the Combo Box and Check Box are on a User Form. The
latest code tried is:

Private Sub cmbMembers_Change()
If Val(cmbMembers.Value) 0 Then
Cells(cmbMembers.Value, 1).Select
CheckBox1.Enabled = True: Value = False
Else
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
End If
End Sub

Any help will be appreciated...

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Setting a CheckBox Value to False

Private Sub cmbMembers_Change()
If Val(cmbMembers.Value) 0 Then
Cells(cmbMembers.Value, 1).Select
CheckBox1.Enabled = True
CheckBox1.Value = False
Else
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
End If
End Sub



"The Hawk" wrote in message
...
Hi: I'd like to set a checkbox value to false after selection of an item
from a Combo Box. I've tried various things, but cannot seem to get the
correct syntax. Both the Combo Box and Check Box are on a User Form. The
latest code tried is:

Private Sub cmbMembers_Change()
If Val(cmbMembers.Value) 0 Then
Cells(cmbMembers.Value, 1).Select
CheckBox1.Enabled = True: Value = False
Else
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
End If
End Sub

Any help will be appreciated...



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Setting a CheckBox Value to False


or

With CheckBox1
..Enabled = True
..Value = False
End With


--
Raman325
------------------------------------------------------------------------
Raman325's Profile: http://www.excelforum.com/member.php...o&userid=24748
View this thread: http://www.excelforum.com/showthread...hreadid=395909



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Setting a CheckBox Value to False


Or:

'I am assuming the name of the form is UserForm1

UserForm1.Controls("CheckBox1").Value = False

Hope this helps

theguz


--
theguz
------------------------------------------------------------------------
theguz's Profile: http://www.excelforum.com/member.php...o&userid=24918
View this thread: http://www.excelforum.com/showthread...hreadid=395909

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
[excel] checkbox = false = ukryj kilka komórek/wierszy/kolumn OCTOBeer Excel Discussion (Misc queries) 0 February 12th 09 08:14 PM
I need to create a simple checkbox that has true false outputs RCN Excel Discussion (Misc queries) 1 June 6th 06 08:28 PM
Setting Default of Checkbox based on value of combobox Lost![_5_] Excel Programming 1 June 9th 05 07:35 PM
Checkbox toggle true/false Donkin Excel Programming 3 June 2nd 05 09:37 AM
Setting LinkedCell on a CheckBox Control scottrell Excel Programming 2 July 30th 04 11:06 PM


All times are GMT +1. The time now is 06:35 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"