L
LOREAUX
Guest
j'ai 24 listbox allant de listbox1 à listbox24
et 24 variable NOM allant de ChoixNOM1 à ChoixNOM24
JE SUIS OBLIGE D'ECRIRE 24 FOIS LE MEME CODE INCREMENTE DE 1 A 24 CHAQUE FOIS EX:
LstNOM1 = Range("B2").End(xlDown).Address
ListBox1.RowSource = "B2:" & LstNOM1
ListBox1.ListIndex = 0
........
ListBox24.RowSource = "B2:" & LstNOM1
ListBox24.ListIndex = 0
Range("F8").select
Index1 = ListBox1.ListIndex
ChoixNOM1 = ListBox1.List(Index1)
ActiveCell = ChoixNOM1 'variable NOM
ActiveCell.Offset(ROWOFFSET:=1, columnoffset:=0).Activate
.......
Index24 = ListBox24.ListIndex
ChoixNOM24 = ListBox24.List(Index24)
ActiveCell = ChoixNOM24
.
****************************
est-il possible en faisant une boucle FOR I=1 TO 24 .....NEXT I
d'affecter "I" par incrementation à
LstNOM, ListBox, Index, ChoixNOM
sous la forme
********
FOR I=1 TO 24
LstNOM & I = Range("B2").End(xlDown).Address
ListBox & I.RowSource = "B2:" & LstNOM & I
ListBox & I.ListIndex = 0
........
LstNOM & I.RowSource = "B2:" & LstNOM & I
ListBox & I.ListIndex = 0
Range("F8").select
Index & I = ListBox & I.ListIndex
ChoixNOM & I = ListBox & I.List(Index1)
ActiveCell = ChoixNOM & I 'variable NOM
ActiveCell.Offset(ROWOFFSET:=1, columnoffset:=0).Activate
.......
Index & I = ListBox & I.ListIndex
ChoixNOM & I = ListBox & I.List(Index1)
ActiveCell = ChoixNOM & I 'variable NOM
NEXT I
J'AI TOUT ESSAYE MAIS RIEN NE MARCHE
QUELQU'UN A T'IL UNE SOLUTION. MERCI
et 24 variable NOM allant de ChoixNOM1 à ChoixNOM24
JE SUIS OBLIGE D'ECRIRE 24 FOIS LE MEME CODE INCREMENTE DE 1 A 24 CHAQUE FOIS EX:
LstNOM1 = Range("B2").End(xlDown).Address
ListBox1.RowSource = "B2:" & LstNOM1
ListBox1.ListIndex = 0
........
ListBox24.RowSource = "B2:" & LstNOM1
ListBox24.ListIndex = 0
Range("F8").select
Index1 = ListBox1.ListIndex
ChoixNOM1 = ListBox1.List(Index1)
ActiveCell = ChoixNOM1 'variable NOM
ActiveCell.Offset(ROWOFFSET:=1, columnoffset:=0).Activate
.......
Index24 = ListBox24.ListIndex
ChoixNOM24 = ListBox24.List(Index24)
ActiveCell = ChoixNOM24
.
****************************
est-il possible en faisant une boucle FOR I=1 TO 24 .....NEXT I
d'affecter "I" par incrementation à
LstNOM, ListBox, Index, ChoixNOM
sous la forme
********
FOR I=1 TO 24
LstNOM & I = Range("B2").End(xlDown).Address
ListBox & I.RowSource = "B2:" & LstNOM & I
ListBox & I.ListIndex = 0
........
LstNOM & I.RowSource = "B2:" & LstNOM & I
ListBox & I.ListIndex = 0
Range("F8").select
Index & I = ListBox & I.ListIndex
ChoixNOM & I = ListBox & I.List(Index1)
ActiveCell = ChoixNOM & I 'variable NOM
ActiveCell.Offset(ROWOFFSET:=1, columnoffset:=0).Activate
.......
Index & I = ListBox & I.ListIndex
ChoixNOM & I = ListBox & I.List(Index1)
ActiveCell = ChoixNOM & I 'variable NOM
NEXT I
J'AI TOUT ESSAYE MAIS RIEN NE MARCHE
QUELQU'UN A T'IL UNE SOLUTION. MERCI