I put two comboboxes from the Control toolbox toolbar on a new worksheet.
I double clicked on the top one and inserted this code:
Option Explicit
Private Sub ComboBox1_Change()
Select Case LCase(Me.ComboBox1.Value)
Case Is = "aaa", "bbb", "ccc"
Me.ComboBox2.ListRows = 8
Case Else
Me.ComboBox2.ListRows = 25
End Select
End Sub
I put test data in A1:A100 and assigned .listfillrange of each to A1:A100
littlegreenmen1 wrote:
i am trying to find a way to resize a combo box depending on how many
possible choices there are. for example, i have a combo box (cb#1)
that allows me to select from a list of vendors. the drop down size of
this box stays constant. then in the second combo box (cb#2) a list of
materials is displayed. my problem is that not all vendors have the
same number of materials. so if i select vendor A (who has 3
materials) in cb#1, then i would like cb#2 to have a drop down line
amount of 3. then if i pick vendor B (who has 100-item long list) i
would need the drop down line amount to be 100. right now it's set for
the maximum number of drop down lines which is a bit overkill if there's
only 3 items. i dont know if it matters but i'm using the combo box
from the form toolbar not the control toolbar. any help on my dilema
would be much appreciated. thank you in advance.
--
littlegreenmen1
------------------------------------------------------------------------
littlegreenmen1's Profile: http://www.excelforum.com/member.php...o&userid=23978
View this thread: http://www.excelforum.com/showthread...hreadid=376843
--
Dave Peterson