Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Count CheckBoxes in a Frame that are True

I want to disable a ComboBox if all 4 CheckBox Values in a UserForm Frame are
True. How do I do this?

Ryan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Count CheckBoxes in a Frame that are True

The easy way is:
if checkbox1=true then
if checkbox2=true then
if checkbox3=true then
if checkbox4=true then
combobox1.Enabled=False
end if
end if
end if
end if
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"RyanH" wrote:

I want to disable a ComboBox if all 4 CheckBox Values in a UserForm Frame are
True. How do I do this?

Ryan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Count CheckBoxes in a Frame that are True

That is an easy way to do it! Do you know of a cleaner way to do it, like a
Loop? Such as count the true check boxes and if it = 4 then disable combobox.
I assume I have to put this code under the Click_Event of each checkbox so
if it is shorter to write a loop I would prefer that. Not to be picky or
anything, lol.

Thanks for the quick response,
Ryan

"John Bundy" wrote:

The easy way is:
if checkbox1=true then
if checkbox2=true then
if checkbox3=true then
if checkbox4=true then
combobox1.Enabled=False
end if
end if
end if
end if
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"RyanH" wrote:

I want to disable a ComboBox if all 4 CheckBox Values in a UserForm Frame are
True. How do I do this?

Ryan

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Count CheckBoxes in a Frame that are True

I am sure this can be done a better way but as a quick suggestion following
may do what you want (not tested):

Dim i As Integer
Dim a As Integer
a = 0
For i = 1 To 4
If Controls("CheckBox" & i).Value = True Then
a = a + 1
End If
Next

With ComboBox1
If a = 4 Then
.Enabled = False
Else
.Enabled = True
End If
End With
--
JB


"RyanH" wrote:

I want to disable a ComboBox if all 4 CheckBox Values in a UserForm Frame are
True. How do I do this?

Ryan

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Count CheckBoxes in a Frame that are True


Take the product of their values and if not equal to zero then all are checked.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"RyanH"
wrote in message
I want to disable a ComboBox if all 4 CheckBox Values in a UserForm Frame are
True. How do I do this?
Ryan


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
TRUE/FALSE from checkboxes Phil Davy Excel Discussion (Misc queries) 4 September 27th 07 04:09 PM
Sow do i make a userform know if a value is true in a frame, then CSUS_CE_Student[_2_] Excel Discussion (Misc queries) 1 May 13th 07 11:30 PM
Assessing whether any checkboxes are checked within frame ExcelMonkey Excel Programming 1 October 16th 05 09:19 PM
True/False Checkboxes dankim Excel Programming 1 July 12th 04 05:59 PM
Counting checkboxes with a true value Antje Crawford Excel Programming 2 November 7th 03 06:48 PM


All times are GMT +1. The time now is 12:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"