Linking two combo boxes together

rayzgurl

New Member
Joined
Feb 4, 2004
Messages
35
I have two combo boxes. The first box contains a list of 3 items. I want the list of items in the second box to vary depending on what is selected in the first box. I have them linked and when I select an item from the first box, it loads the correct list into the second box. However, when I select a different item from the first list, it loads what is associated with that selection and does not unload what was in there previouly. I've tried using a clear statement but it is not working. Below is the code I am using.

Thanks,

Pam


---------------------

Private Sub UserForm_Initialize()
' Fill Credit Category
With CreditForm.CategoryCombo
.RowSource = ""
.AddItem "Customer Satisfaction"
.AddItem "Billing Issues"
.AddItem "Acct/Mobile Setup"
End With
End Sub


Private Sub CategoryCombo_Change()
With CreditForm.CreditDetailCombo
If CategoryCombo.Value = "Customer Satisfaction" Then
.RowSource = ""
.AddItem "Domestic Roaming"
.AddItem "International Roaming"
.AddItem "Airtime Overage"
.AddItem "ReRate past bills after rate plan change"
.AddItem "Directory Assist Calls"
.AddItem "Text Messages"
.AddItem "Multi-Media Messaging"
.AddItem "Monthly Access"
.AddItem "Upgrade Fees"
.AddItem "Activation Fees"
.AddItem "Reconnect Fees"
.AddItem "Late Fees"
.AddItem "Liquidation Damages"

ElseIf CategoryCombo.Value = "Billing Issues" Then
.RowSource = ""
.AddItem "Roaming Towers Not Loaded"
.AddItem "Roaming Feature in CARE not Working"
.AddItem "M2M not Rating Correctly"
.AddItem "Roaming Towers Double Billing"
.AddItem "Feature Showing in CARE but not in Pricing"
.AddItem "Price Plan Changes not Processing in CARE"
.AddItem "Features not Auto Attaching w/Rate Plan Change"
.AddItem "Future Dated Changes not Processing on Bill Cycle Date"

Else:
.RowSource = ""
.AddItem "Tax Flags not Adjusted Correctly"
.AddItem "Incorrect Rate Plan"
.AddItem "More than 1 Primary Line on Pool Plan"
.AddItem "Incorrect Features Added"
.AddItem "NW Feature Never Added"
.AddItem "M2M Feature Never Added"
.AddItem "Wrong Text Messaging Plan Added"
.AddItem "Customer Mis-Informed About How Plan Works"
.AddItem "Customer Thought Had Feature not Included w/Plan"
.AddItem "Account not Terminated When Cust Requested"
End If
End With
End Sub
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Change the name to your combobox and place in front of adding items to clear existing entries.

Code:
For x = ComboBox1.ListCount To 1 Step -1
ComboBox1.RemoveItem (0)


HopeThatHelps
 
Upvote 0

Forum statistics

Threads
1,213,549
Messages
6,114,261
Members
448,558
Latest member
aivin

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