Excel VBA userform 3 dependent comboboxes

vbacombo

New Member
Joined
Sep 6, 2017
Messages
1
I have created a userform that uses 3 dependent comboboxes to calculate the price of a tour. Once I have filtered through the levels, I am then trying to pull in that tour's specific data such as prices. The program I have works though only up to a point. After I increase the number of objects added to the for loop in combobox3 past 8 objects, I get an error of "Method 'Range' of the object '_Global' non riuscito".

I am using 3 scripted dictionaries for the CB filtering:

There error is in here:

Private Sub ComboBox3_Change()
If ComboBox1 <> "" And ComboBox2 <> "" Then
If ComboBox3.ListIndex = -1 And IsError(Application.Match(ComboBox3, Tour, 0)) Then
Set SD = CreateObject("Scripting.Dictionary")
bul = UCase(ComboBox3) & "*"
For Each c In tablo3
If c Like bul Then SD(c) = ""
Next c
ComboBox3.List = SD.keys
ComboBox3.DropDown
Else
ara_1 = ComboBox1.Text
ara_2 = ComboBox2.Text
ara_3 = ComboBox3.Value
For i = LBound(Tour) To UBound(Tour)
If CustType(i) = ara_1 And Prototype(i) = ara_2 And Tour(i) = ara_3 Then
TextBox1.Value = Code(i)
ComboBox10.Text = MeetingPoint1(i)
ComboBox12.Text = MeetingPoint2(i)
TextBox20.Value = Duration(i)
TextBox9.Value = Tier1(i)
TextBox10.Value = Price1(i)
TextBox11.Value = Tier2(i)
TextBox12.Value = Price2(i)
TextBox21.Value = Tier3(i)
TextBox22.Value = Price3(i)
End If
Next i
TextBox2.SetFocus
If Val(Application.Version) > 10 Then SendKeys "{f4}"
End If
ComboBox3.BackColor = &H80FFFF
End If
End Sub
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,214,611
Messages
6,120,509
Members
448,967
Latest member
screechyboy79

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top