Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default 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
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
Hiding a ComboBox with a Checkbox AWeb Excel Worksheet Functions 2 September 15th 06 01:30 PM
Setting default pivot table field setting to "sum" Mr. Moose Excel Discussion (Misc queries) 2 December 21st 04 04:43 PM
CheckBox and ComboBox controls move on previewing or printing Stephen W. Hiemstra Excel Programming 1 November 13th 04 02:02 AM
Setting LinkedCell on a CheckBox Control scottrell Excel Programming 2 July 30th 04 11:06 PM
CheckBox controling a ComboBox Dillonstar Excel Programming 3 October 23rd 03 05:56 PM


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