Quote Originally Posted by Paul_Hossler View Post
1. These are 9 different products stored as 9 simple Strings -- OK

'data type product 1-3
Dim DOC As String: DOC = "Product 1"
Dim DOK As String: DOK = "Product 2"
Dim DOB As String: DOB = "Product 3"

'data type product 4-6
Dim KC As String: KC = "Product 4"
Dim KK As String: KK = "Product 5"
Dim KB As String: KB = "Product 6"

'data type product 7-9
Dim SCo As String: SCo = "Product 7"
Dim SKl As String: SKl = "Product 8"
Dim SCi As String: SCi = "Product 9"

2. These are 3 'other' variables - I'm guessing that Dim Sna should be Snack, etc

'data type combination
Dim Snack As String: Snack = SCo Or SKl Or SCi
Dim Dortik As String: Dortik = DOC Or DOK
Dim Korpus As String: Korpus = KK Or KB
3.
If (set1.Value = KC And (set1.Value = K1 Or set12.Value = K2) And set13.Value = T2) Then

What is set1, set2, and set3?

set1,set2, and set3 are listbox with data from excel

)
What is K1, K2, and T2?
)
This is names for products upper its not part of code what i post here



4.
ElseIf ((set1.Value = DC Or set1.Value = DK Or set1.Value = DCi Or set1.Value = DB Or set1.Value = DM) And set13.Value = Kor) Then
What is DC, DK, DCi, DB, DM, Kor?
This also is names for products upper


5. Just taking a guess

Option Explicit




Sub test()
    Const Snack As String = "SCo#SKl#SCi#"
    Const Dortik As String = "DOC#DOK#"
    Const Korpus As String = "KK#KB#"
    
    If InStr(Snack, "SKl#") > 0 Then
        MsgBox "SKl is a Snack"
    Else
       MsgBox "SKl is not a Snack"
    End If
    
    MsgBox "SKl is " & IIf(InStr(Snack, "SKl#") > 0, "", "not ") & "a Snack"
    MsgBox "KK is " & IIf(InStr(Snack, "KK#") > 0, "", "not ") & "a Snack"
End Sub

but if there's a lot, I'd build a mini-database on a worksheet and use that, but it's only a guess since it's not clear to me what you want to do

---------------------------------------------------------
This seems to work
(Const Snack As String = "SCo#SKl#SCi#"
Const Dortik As String = "DOC#DOK#"
Const Korpus As String = "KK#KB#")


i have a 6 different listboxs, if i select all six conditions it start with first Elseif where are 3 condition


ElseIf (set1.Value = DC And set11.Value = K2 And set12.Value = T2 And settime.Value <= 12) Then (put here something like set21.value xxx(if nothing selected in textbox), set22.value xxx, set22.value xxx)?
MsgBox "L2 production"

ElseIf (set1.Value = DC And set11.Value = K1 And set12.Value = T2 And (set21.Value = Snack Or set21.Value = Korpus Or set21.Value = Dortik) And set22.Value = K1 And set23.Value = T1 And settime.Value <= 12) Then
MsgBox "different line for production"