Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
CheckBox values based on Worksheet condition
I have six checkboxes on a user form. Each checkbox makes a condition in
the worksheet true if checked on the form. After clicking OK on the userform, each worksheet condition is set to false, and only the checked boxes are set to true. Is it possible to show the status of each worksheet condition when the user form is opened by showing the corresponding checkbox as checked? Example: In the worksheet, Cond A = true Cond B = false Cond C = true Cond D, E & F are all false. When opening the user form, is it possible to populate the checkboxes for CondA and CondC with an 'x' on the userform? If so, how? This is what I have so far, the name of the form is Manage_Feeds_Form. Sub ShowFeedsForm() 'Check status of feeds and indicate on form Manage_Feeds_Form.Show If "CondA in the worksheet = true" Then cb_CondA.Value = True ditto for CondB thru CondF End Sub Thanks, Steve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
CheckBox values based on Worksheet condition
Simplest way would be to include all the code for setting the form's
checkbox values in the form's Initialize event. In the userform module, in the top middle dropdown select Userform and in the right dropdown select Initialize to write the Event stub. Alternatively you could do similar in your proc ShowFeedsForm, something like this Dim bFlag as boolean Dim frm as Manage_Feeds_Form bFlag = CondA in the worksheet frm.cb_CondA.Value = bFlag 'etc frm.Show Regards, Peter T "Steve Morgan" wrote in message ... I have six checkboxes on a user form. Each checkbox makes a condition in the worksheet true if checked on the form. After clicking OK on the userform, each worksheet condition is set to false, and only the checked boxes are set to true. Is it possible to show the status of each worksheet condition when the user form is opened by showing the corresponding checkbox as checked? Example: In the worksheet, Cond A = true Cond B = false Cond C = true Cond D, E & F are all false. When opening the user form, is it possible to populate the checkboxes for CondA and CondC with an 'x' on the userform? If so, how? This is what I have so far, the name of the form is Manage_Feeds_Form. Sub ShowFeedsForm() 'Check status of feeds and indicate on form Manage_Feeds_Form.Show If "CondA in the worksheet = true" Then cb_CondA.Value = True ditto for CondB thru CondF End Sub Thanks, Steve |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
CheckBox values based on Worksheet condition
Peter T -
Thanks. This worked great. Steve "Peter T" wrote in message ... Simplest way would be to include all the code for setting the form's checkbox values in the form's Initialize event. In the userform module, in the top middle dropdown select Userform and in the right dropdown select Initialize to write the Event stub. Alternatively you could do similar in your proc ShowFeedsForm, something like this Dim bFlag as boolean Dim frm as Manage_Feeds_Form bFlag = CondA in the worksheet frm.cb_CondA.Value = bFlag 'etc frm.Show Regards, Peter T "Steve Morgan" wrote in message ... I have six checkboxes on a user form. Each checkbox makes a condition in the worksheet true if checked on the form. After clicking OK on the userform, each worksheet condition is set to false, and only the checked boxes are set to true. Is it possible to show the status of each worksheet condition when the user form is opened by showing the corresponding checkbox as checked? Example: In the worksheet, Cond A = true Cond B = false Cond C = true Cond D, E & F are all false. When opening the user form, is it possible to populate the checkboxes for CondA and CondC with an 'x' on the userform? If so, how? This is what I have so far, the name of the form is Manage_Feeds_Form. Sub ShowFeedsForm() 'Check status of feeds and indicate on form Manage_Feeds_Form.Show If "CondA in the worksheet = true" Then cb_CondA.Value = True ditto for CondB thru CondF End Sub Thanks, Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trying to lookup based on a condition of two values | Excel Worksheet Functions | |||
Sum table values based on condition | Excel Worksheet Functions | |||
Grouping and summing values based on a condition? | Excel Programming | |||
Hide Columns based on checkbox values | Excel Programming | |||
Cannot sum values based on condition | Excel Worksheet Functions |