R
rémi
Guest
bonjour,
Quelqu'un peux il me dire s'il existe une fonction ds vb pour désigner indirectement une variable à l'aide d'une chaine de caractères ?? (fonction existante - et trés utile - en turbo pascal)
Exemple :
Je cherche à remplacer ceci :
R1.Caption = Cells(a, 17 + (2 * 1)).Value
R2.Caption = Cells(a, 17 + (2 * 2)).Value
R3.Caption = Cells(a, 17 + (2 * 3)).Value
R4.Caption = Cells(a, 17 + (2 * 4)).Value
R5.Caption = Cells(a, 17 + (2 * 5)).Value
R6.Caption = Cells(a, 17 + (2 * 6)).Value
R7.Caption = Cells(a, 17 + (2 * 7)).Value
R8.Caption = Cells(a, 17 + (2 * 8)).Value
R9.Caption = Cells(a, 17 + (2 * 9)).Value
R10.Caption = Cells(a, 17 + (2 * 10)).Value
R11.Caption = Cells(a, 17 + (2 * 11)).Value
R12.Caption = Cells(a, 17 + (2 * 12)).Value
par ceci :
For n = 1 To 12
#("R"&cstr(n)).Caption = Cells(a, 17 + (2 * n)).Value
Next n
où #("R"&cstr(n)) devrait désigner R1 à R12 en fonction de n....
NB: n'ai aucune idée de la syntaxe sous vb... je reproduit ici la syntaxe de la chaine d'indirection sur Ti92 - 89
Quelqu'un peux il me dire s'il existe une fonction ds vb pour désigner indirectement une variable à l'aide d'une chaine de caractères ?? (fonction existante - et trés utile - en turbo pascal)
Exemple :
Je cherche à remplacer ceci :
R1.Caption = Cells(a, 17 + (2 * 1)).Value
R2.Caption = Cells(a, 17 + (2 * 2)).Value
R3.Caption = Cells(a, 17 + (2 * 3)).Value
R4.Caption = Cells(a, 17 + (2 * 4)).Value
R5.Caption = Cells(a, 17 + (2 * 5)).Value
R6.Caption = Cells(a, 17 + (2 * 6)).Value
R7.Caption = Cells(a, 17 + (2 * 7)).Value
R8.Caption = Cells(a, 17 + (2 * 8)).Value
R9.Caption = Cells(a, 17 + (2 * 9)).Value
R10.Caption = Cells(a, 17 + (2 * 10)).Value
R11.Caption = Cells(a, 17 + (2 * 11)).Value
R12.Caption = Cells(a, 17 + (2 * 12)).Value
par ceci :
For n = 1 To 12
#("R"&cstr(n)).Caption = Cells(a, 17 + (2 * n)).Value
Next n
où #("R"&cstr(n)) devrait désigner R1 à R12 en fonction de n....
NB: n'ai aucune idée de la syntaxe sous vb... je reproduit ici la syntaxe de la chaine d'indirection sur Ti92 - 89