MrSteve
11-22-2007, 03:48 AM
So my boss in work has given me a VBA task this week. I've never used VBA before, and as the "technical guy" in the office I always get given these tasks... :banghead:
This is what he wants -
He has an excel template which has data validation on the first two columns. So for example if he selects a country from the listbox in column1, the city listbox in column2 will automatically update with values.
He wants me to add a listbox in column3 which automatically updates based on whatever is selected in column2, and a listbox in column4 which automatically updates based on whatever is selected on column3, etc.
Also, when he goes to a new row, a country listbox should appear in the first column, so he can run through the process again...
Is there any way in VBA to do something similar to data validation, except I can make decisions using IF statements? So if country = USA, cities = this big list.
Is this possible?
The spreadsheet needs to keep the same "feel" as data validation if possible.
I've been trying to figure this out but I'm not getting anywhere. Any help greatly appreciated. Thanks!
This is what he wants -
He has an excel template which has data validation on the first two columns. So for example if he selects a country from the listbox in column1, the city listbox in column2 will automatically update with values.
He wants me to add a listbox in column3 which automatically updates based on whatever is selected in column2, and a listbox in column4 which automatically updates based on whatever is selected on column3, etc.
Also, when he goes to a new row, a country listbox should appear in the first column, so he can run through the process again...
Is there any way in VBA to do something similar to data validation, except I can make decisions using IF statements? So if country = USA, cities = this big list.
Is this possible?
The spreadsheet needs to keep the same "feel" as data validation if possible.
I've been trying to figure this out but I'm not getting anywhere. Any help greatly appreciated. Thanks!