Sub Test1()
Dim tablo(1 To 3, 1 To 2), col As Byte, FRUITS As String
'---tableau à renseigner---
tablo(1, 1) = "banane": tablo(1, 2) = 0
tablo(2, 1) = "pomme": tablo(2, 2) = 1
tablo(3, 1) = "Kiwi": tablo(3, 2) = 1
'---concaténations---
For col = 1 To 2
FRUITS = "(" & tablo(1, col) & IIf(col = 1, " ET ", " * ") & tablo(2, col) & ")" & IIf(col = 1, " OU ", " + ") & tablo(3, col) 'adapter ET/OU
MsgBox "FRUITS = " & FRUITS, , IIf(col = 1, "1ère", "2ème") & " concaténation"
Next
'---résultat---
MsgBox "FRUITS = " & Evaluate(FRUITS), , "Résultat"
End Sub
Sub Test2()
Dim tablo(1 To 3, 1 To 2), col As Byte, FRUITS As String
'---tableau à renseigner---
tablo(1, 1) = "raisin": tablo(1, 2) = 1
tablo(2, 1) = "fraise": tablo(2, 2) = 1
tablo(3, 1) = "Citron": tablo(3, 2) = 1
'---concaténations---
For col = 1 To 2
FRUITS = "(" & tablo(1, col) & IIf(col = 1, " OU ", " + ") & tablo(2, col) & ")" & IIf(col = 1, " ET ", " * ") & tablo(3, col) 'adapter ET/OU
MsgBox "FRUITS = " & FRUITS, , IIf(col = 1, "1ère", "2ème") & " concaténation"
Next
'---résultat---
MsgBox "FRUITS = " & Evaluate(FRUITS), , "Résultat"
End Sub