Jill Gordon
April 25th, 2001, 12:32 PM
I am creating a visual basic program in excel for a car sales business. I have used comboboxes for both the car manufacturer and model because I needed connecting drop-down lists. I now want to add two more comboboxes for registration number and price of car.
In sheet 1 (for my models) I have written:
If ComboBox1.List(ComboBox1.ListIndex) = "Alfa Romeo" Then
ComboBox2.AddItem "145"
ComboBox2.AddItem "146" etc
But, now I need a way of adding registration numbers for each of the models. I can't just write :
If ComboBox2.List(ComboBox2.ListIndex) = "145"
This is because some manufacturers have models of cars with the same name as other manufacturers do, e.g there is an Alfa Romeo Spider and a Ferrari Spider.
So, I need to know what to write when it depends on several criteria.
If anyone could help, I would be very grateful.
In sheet 1 (for my models) I have written:
If ComboBox1.List(ComboBox1.ListIndex) = "Alfa Romeo" Then
ComboBox2.AddItem "145"
ComboBox2.AddItem "146" etc
But, now I need a way of adding registration numbers for each of the models. I can't just write :
If ComboBox2.List(ComboBox2.ListIndex) = "145"
This is because some manufacturers have models of cars with the same name as other manufacturers do, e.g there is an Alfa Romeo Spider and a Ferrari Spider.
So, I need to know what to write when it depends on several criteria.
If anyone could help, I would be very grateful.