Aretradeser
Board Regular
- Joined
- Jan 16, 2013
- Messages
- 176
- Office Version
- 2013
- Platform
- Windows
In an Excel sheet I have data sorted in titled columns.
In column "B", COUNTRY ORIGIN, there are many countries.
In column "C", ORIGIN CITY, many cities, but always belonging to the country in the same row of column "B".
In column "F", DESTINATION COUNTRY, there are many countries.
In column "G", DESTINATION CITY, there are many cities that also belong to the country that is in the same row of column "F".
In a Userform that I use for data entry, there are ComboBox1 (CountryOrigin) and ComboBox2 (CityOrigin), ComboBox3 (CountryDestination) and ComboBox4 (CityDestination).
What I need is a macro code that does the following:
1.- That when loading the ComboBox1 it adds all the countries of the column "B", without repeating countries; that is to say, unique values.
2.- That the ComboBox2 adds only the cities of the column "C", without repeating; but belonging to the country that we have selected in the ComboBox1.
3.- That when the ComboBox3 is loaded, it adds all the countries in column "F, without repeating countries; that is to say, unique values.
4.- That the ComboBox4 adds only the cities in column "G", without repeating cities; but belonging to the country that we have selected in the ComboBox3.
Thank you very much
In column "B", COUNTRY ORIGIN, there are many countries.
In column "C", ORIGIN CITY, many cities, but always belonging to the country in the same row of column "B".
In column "F", DESTINATION COUNTRY, there are many countries.
In column "G", DESTINATION CITY, there are many cities that also belong to the country that is in the same row of column "F".
In a Userform that I use for data entry, there are ComboBox1 (CountryOrigin) and ComboBox2 (CityOrigin), ComboBox3 (CountryDestination) and ComboBox4 (CityDestination).
What I need is a macro code that does the following:
1.- That when loading the ComboBox1 it adds all the countries of the column "B", without repeating countries; that is to say, unique values.
2.- That the ComboBox2 adds only the cities of the column "C", without repeating; but belonging to the country that we have selected in the ComboBox1.
3.- That when the ComboBox3 is loaded, it adds all the countries in column "F, without repeating countries; that is to say, unique values.
4.- That the ComboBox4 adds only the cities in column "G", without repeating cities; but belonging to the country that we have selected in the ComboBox3.
Thank you very much