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