Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting Default of Checkbox based on value of combobox
I have a combobox that is a drop-down menu on one userform. Anothe userform on the sheet is made up only of checkboxes. I want the defaul for one of the checkboxes to be determined by the combobox. If on option, "RCP", is selected, I want the checkbox default to be true. I any of the other options are selected for the combobox, I want th default to be false. Here's the code I was using: Range("h17").Select 'H17 is where the combobox results ar displayed If ActiveCell.Value = rcp Then cbx3099 = True Else: cbx3099 = False End If I have this in the initialize sub for the checkbox userform. I trie putting RCP in quotes, but it made no difference. Thanks -- Lost ----------------------------------------------------------------------- Lost!'s Profile: http://www.excelforum.com/member.php...fo&userid=2399 View this thread: http://www.excelforum.com/showthread.php?threadid=37780 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting Default of Checkbox based on value of combobox
-- When you lose your mind, you free your life. "Lost!" wrote: I have a combobox that is a drop-down menu on one userform. Another userform on the sheet is made up only of checkboxes. I want the default for one of the checkboxes to be determined by the combobox. If one option, "RCP", is selected, I want the checkbox default to be true. If any of the other options are selected for the combobox, I want the default to be false. Here's the code I was using: Range("h17").Select 'H17 is where the combobox results are displayed If ActiveCell.Value = rcp Then cbx3099 = True Else: cbx3099 = False End If I have this in the initialize sub for the checkbox userform. I tried putting RCP in quotes, but it made no difference. Thanks! -- Lost! ------------------------------------------------------------------------ Lost!'s Profile: http://www.excelforum.com/member.php...o&userid=23990 View this thread: http://www.excelforum.com/showthread...hreadid=377808 A couple of points, FIrst where is this code at? is it in a Regular module or in an object module? (Sheet1 Sheet2 ThisWorkbook, etc...) If in a regular Module you must tell VBA where to find the check box also capitolize rcp use the following Range("h17").Select 'H17 is where the combobox results are displayed If ActiveCell.Value = "RCP" Then sheet1.cbx3099 = True Else: sheet1.cbx3099 = False End If if the checkbox is on a different sheet use the correct sheet number for instance sheet2.cbx3099 sheet3.cbx3099 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hiding a ComboBox with a Checkbox | Excel Worksheet Functions | |||
Setting default pivot table field setting to "sum" | Excel Discussion (Misc queries) | |||
CheckBox and ComboBox controls move on previewing or printing | Excel Programming | |||
Setting LinkedCell on a CheckBox Control | Excel Programming | |||
CheckBox controling a ComboBox | Excel Programming |