Bonjour,

je voudrais créer un tableau à deux dimensions. Le problème est que la taille du tableau n'est pas fixe. C'est facile me direz vous, il suffit de faire un tableau dynamique.

le problème c'est que voilà, j'ai des données qui change en fonction d'un bouton option:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
If (OptionButton_lot.Value = True) Then
        montant_ht = "lot 1 : " + TextBox_ht + "€"
    ElseIf (OptionButton_bon_commande.Value = True) Then
        montant_ht = "min : " + TextBox_ht + "€"
    Else
        montant_ht = TextBox_ht
    End If
------------------------------------------------
 
If (OptionButton_lot.Value = True) Then
        montant_ht_max = "lot 2 : " + TextBox_ht_max + "€"
    ElseIf (OptionButton_bon_commande.Value = True) Then
        montant_ht_max = "max : " + TextBox_ht_max + "€"
    End If
 
-----------------------------------------------------
 
montant_lot_3 = "lot 3 : " + TextBox_lot_3 + "€"
 
------------------------------------------------------
 
montant_lot_4 = "lot 4 : " + TextBox_lot_4 + "€"
Normalement que j'ai 1, 2, 3 ou 4 montant je devrais afficher les 4(ou les 2, ou les 3 selon les cas les une en dessous des autres avec ceci:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
montant = IIf(montant_ht <> vbNullString, montant_ht & Chr(10), vbNullString) & _
      IIf(montant_ht_max <> vbNullString, montant_ht_max & Chr(10), vbNullString) & _
      IIf(montant_lot_3 <> vbNullString, montant_lot_3 & Chr(10), vbNullString) & _
      IIf(montant_lot_4 <> vbNullString, montant_lot_4 & Chr(10), vbNullString)
Cela me permettait en plus de les mettre en forme comme je le souhaite mais cela ne fonctionne pas.

D'où le post et la question comment faire un tableau à deux dimension qui me permettrait de faire ça? J'ai bien pensé à faire une ou quatre fonctions avec chaque fois un tableau mais n'étant pas un cador je souhaiterais avoir un (des) avis sur la solutions à employer.