I think I may have made my last post to complicated and confusing. I'm going to try and break down the issues one by one and hopefully I can get some help that way.
Here is a link to my other thread if you care to look at what I have done so far and what I trying to accomplish [url]http://www.mrexcel.com/forum/excel-questions/870746-very-detailed-visual-basic-applications-activex-cascading-dependent-comboboxs-issues-any-all-input-welcome.html
[/URL]
Issue # 1
This is installed on the worksheet("CHART") and is used to fill the second Combobox called cmbSub based on the selection in the first ComboBox cmbRent. I am trying to learn while I am working
Its not working properly.
What it does do is fills the second ComboBox based on the selection in the first combobox but only when the selection in the first combobox matches exactly the coresponding choices in the the "SUB-CATEGORY" range. For example, When Accumulator is selected for the Category, it shows Accumulator multiple times as a Sub-Category option. However when a Category such as Flange,Adapter or Gate Valve is chosen that has multiple coresponding unique Sub-Category options it does not fill anything in to the "Sub-Category" combobox and remains blank.
I am needing the "Sub-Category" combobox to be filled with all of the UNIQUE related Sub-Category choices so I can drill down even further based on the selection the user makes.
[TABLE="class: cms_table_cms_table_grid, align: center"]
<tbody>[TR]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
[TABLE="class: cms_table_cms_table_grid, align: center"]
<tbody>[TR]
[/TR]
[TR]
[TD][TABLE="class: cms_table_cms_table_grid, align: center"]
<tbody>[TR]
[TD]Category
[/TD]
[TD]SUB-CATEGORY
[/TD]
[TD]LOCATION
[/TD]
[TD]CUSTOMER
[/TD]
[TD]TOTAL
[/TD]
[/TR]
[TR]
[TD](All)[/TD]
[TD](All)[/TD]
[TD](All)[/TD]
[TD](All)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Accumulator[/TD]
[TD]Accumulator[/TD]
[TD]CAR[/TD]
[TD]XXXX
[/TD]
[TD]$x.xx[/TD]
[/TR]
[TR]
[TD]Accumulator[/TD]
[TD]Accumulator[/TD]
[TD]WCND[/TD]
[TD]YYYY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
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Here is a link to my other thread if you care to look at what I have done so far and what I trying to accomplish [url]http://www.mrexcel.com/forum/excel-questions/870746-very-detailed-visual-basic-applications-activex-cascading-dependent-comboboxs-issues-any-all-input-welcome.html
[/URL]
Issue # 1
This is installed on the worksheet("CHART") and is used to fill the second Combobox called cmbSub based on the selection in the first ComboBox cmbRent. I am trying to learn while I am working
Its not working properly.
Code:
Private Sub cmbRent_change()
myVal = Me.cmbRent.Value
'loop thru col B
lr = ThisWorkbook.Sheets("DATA").Cells(Rows.Count, 1).End(xlUp).Row
'clear cmbSub
Me.cmbSub.Clear
'loop thru
For X = 2 To lr
If myVal = ThisWorkbook.Sheets("DATA").Cells(X, 2) Then
'add to combobox
Me.cmbSub.AddItem ThisWorkbook.Sheets("DATA").Cells(X, 2)
End If
Next X
Me.cmbSub.ListIndex = -1
End Sub
What it does do is fills the second ComboBox based on the selection in the first combobox but only when the selection in the first combobox matches exactly the coresponding choices in the the "SUB-CATEGORY" range. For example, When Accumulator is selected for the Category, it shows Accumulator multiple times as a Sub-Category option. However when a Category such as Flange,Adapter or Gate Valve is chosen that has multiple coresponding unique Sub-Category options it does not fill anything in to the "Sub-Category" combobox and remains blank.
I am needing the "Sub-Category" combobox to be filled with all of the UNIQUE related Sub-Category choices so I can drill down even further based on the selection the user makes.
[TABLE="class: cms_table_cms_table_grid, align: center"]
<tbody>[TR]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
[TABLE="class: cms_table_cms_table_grid, align: center"]
<tbody>[TR]
[/TR]
[TR]
[TD][TABLE="class: cms_table_cms_table_grid, align: center"]
<tbody>[TR]
[TD]Category
[/TD]
[TD]SUB-CATEGORY
[/TD]
[TD]LOCATION
[/TD]
[TD]CUSTOMER
[/TD]
[TD]TOTAL
[/TD]
[/TR]
[TR]
[TD](All)[/TD]
[TD](All)[/TD]
[TD](All)[/TD]
[TD](All)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Accumulator[/TD]
[TD]Accumulator[/TD]
[TD]CAR[/TD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