Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Options and Combo Boxes

I have two options in my data sheet. When the first option is clicked on, I
want a combobox to appear. When the second option is clicked on, I want a
different combobox to appear in the same location as the first. I am having
trouble writing the code for this. I would greatly appreciate it if someone
could help me with this.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Options and Combo Boxes

Think laterally: use the same combo box but repopulate it when the
option is clicked.

mtm4300 wrote:
When the second option is clicked on, I want a different
combobox to appear in the same location as the first.


You can populate a combo box by setting it's .List property to an array
variable (or it's .Column property, if the array is
inconveniently-directed)

Private Sub optFoo_Click()

Dim arrList as Variant
Dim iRow as Integer

If Me.optFoo.Value=True Then
'Code to redimension and populate an array from source 1
arrList = ThisWorkbook.Names!myName.RefersToRange.Value
Else
'Code to redimension and populate an array from source 2
Redim arrList(0 to 6, 0 to 1) ' List property is a zero-based array
For iRow = 0 to 6
arrList(irow, 0) = Chr(64+ iRow)
arrList(irow, 1) = iRow
Next iRow
Else

Me.cboFoo2.Clear
Me.cboFoo2.List = arrList

Erase arrList

End If

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
Getting Combo boxes to change options based on other Combo boxes. Ancient Wolf New Users to Excel 1 March 27th 09 06:29 PM
Selecting subsets using combo boxes or list boxes CLamar Excel Discussion (Misc queries) 0 June 1st 06 07:43 PM
Questions on combo boxes and list boxes. Marc New Users to Excel 1 March 14th 06 09:40 AM
Combo Boxes and Tick Boxes turner2000[_2_] Excel Programming 0 September 29th 04 09:09 PM
List boxes/combo boxes Tibow Excel Programming 3 February 17th 04 12:35 PM


All times are GMT +1. The time now is 09:37 PM.

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"