I'm looking for a solution to create a search function based on two dynamic values/criteria. I have a userform, with a combobox and a textbox.
Criteria 1 is coming from a combobox and should be found in (Column Building Material). Criteria 2 is a life cycle phase and can be a least one or more of the following terms: "A1-A3, A4, C1,C2,C3,C4,D". It can be found in (Column Modul)
The function of the code should be to find a global warming potential (GWP) value (see green box in data table), depending on the building material and life cycle phase. Once this value is found, it should be filled value into a textbox within the userform.
screenshot of my data table and an example:
Let's say the building material "Argeton" is chosen from the combobox. This material has multiple entries and different phases where global warming potential is caused. Now I want to know the GWP Value for e.g. the phase "A4" of "Argeton"
So far my idea was to use an if and then statement:
Dim zelle As String
Dim zelleGWPA4 As Range
Set zelle = Columns(3).Find(what:=cmb_Datensatz.Text, lookat:=xlWhole)
Set zelleGWPA4 = Columns(11).Find(what:="A4", lookat:=xlWhole)
If zelle = cmb_Datensatz.value Then zelle.Offset(0, 8).Select
....
At this point, I don't know how to go on. Since I only detected now the orange cell (see data table) to this point my thought was to search down and look for the term "A4", while the building material is still 'Agreton". Once both criteria are true, go offset(0,1) and fill value of this cell in txt_GWP_A4.
Maybe there are better and easier ways to do this. I'm open to any other ideas and thankful for any help!