For example i have this userform with 3 comboboxes.
let them be combobox_dpfs_system, combobox_dpfs_af, combobox_dpfs_accessory.
combobox_dpfs_system has 2 choices: "System 1" or "System 2"
combobox_dpfs_af has 4 choices: "100 AF", "200 AF", "300 AF", "400 AF"
combobox_accessory has 2 choices: "Pilot Light", "None"
so when the user makes the selections, he/she presses a command button and the code will call up data from a sheet depending on the selections. Here is my problem. An example code i did was something like this:
if combobox_dpfs_system = "System 1" And _
combobox_dpfs_af = "100 AF" and_
combobox_accessory = "None" Then
textbox1 = workbooks("Estimating Program 2014").Sheets("Kanye West").Cells(1,1)
textbox1 = workbooks("Estimating Program 2014").Sheets("Kanye West").Cells(2,2)
end if
if combobox_dpfs_system = "System 2" And _
combobox_dpfs_af = "100 AF" and_
combobox_accessory = "None" Then
textbox1 = workbooks("Estimating Program 2014").Sheets("Kim Kardashian").Cells(1,1)
textbox1 = workbooks("Estimating Program 2014").Sheets("Kim Kardashian").Cells(2,2)
end if
So i would do numerous if-then statements until i cover all the possibilites of the 3 combobox combinations. It is very tedious and i dont think this is the best way of doing it. Is there a way where there will be one IF-then main procedure and only variables will be changed? I really don't know I need help... Thanks...
Bookmarks