Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Deleting Comboboxes

I have two sets of comboboxes.
I set has 5 comboboxes and the other has 7 comboboxes.

In the second set, first five comboboxes are the same as set 1.

If I choose set1, all the comboboxes of set 1 are seen and if I choose set
2, all the comboboxes of set 2 are seen.

Is there a way to code such that depending on what set I choose their
respective comboboxes appear. In other words, I want the two extra comboboxes
to appear and disappear depending on what set is chosen.

Thanks you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Deleting Comboboxes

If you create 7 comboboxes and call then ComboBox1-7. Then create 2
OptionButtons and call them optSet1 and optSet2 then paste the
following code into the form.

Private Sub optSet1_Click()
If optSet1.Value = True Then
Call ChangeComboSet1Visible(True)
Call ChangeComboSet2Visible(False)
End If
End Sub

Private Sub optSet2_Click()
If optSet2.Value = True Then
Call ChangeComboSet1Visible(True)
Call ChangeComboSet2Visible(True)
End If
End Sub

Function ChangeComboSet1Visible(boolVisible As Boolean)
Me.ComboBox1.Visible = boolVisible
Me.ComboBox2.Visible = boolVisible
Me.ComboBox3.Visible = boolVisible
Me.ComboBox4.Visible = boolVisible
Me.ComboBox5.Visible = boolVisible
End Function

Function ChangeComboSet2Visible(boolVisible As Boolean)
Me.ComboBox6.Visible = boolVisible
Me.ComboBox7.Visible = boolVisible
End Function

Private Sub UserForm_Activate()
Call ChangeComboSet1Visible(False)
Call ChangeComboSet2Visible(False)
End Sub

Hope this helps.


On 3 Oct, 15:00, aqualibra
wrote:
I have two sets of comboboxes.
I set has 5 comboboxes and the other has 7 comboboxes.

In the second set, first five comboboxes are the same as set 1.

If *I choose set1, all the comboboxes of set 1 are seen and if I choose set
2, all the comboboxes of set 2 are seen.

Is there a way to code such that depending on what set I choose their
respective comboboxes appear. In other words, I want the two extra comboboxes
to appear and disappear depending on what set is chosen.

Thanks you


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
ComboBoxes in VBA Ronald Dodge[_2_] Excel Programming 4 July 25th 07 01:24 AM
COMBOBOXES Zigball Excel Programming 1 December 19th 06 01:10 AM
comboboxes Zaahir Excel Programming 1 October 27th 06 02:43 PM
OLE comboboxes Mikkan Excel Programming 1 July 23rd 05 12:46 AM
comboboxes lgbjr Excel Programming 8 June 1st 05 06:52 AM


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