cpt =3D 1
For i =3D 7 To 26
If Worksheets("Ted").Range("A" & i).Value <> Empty Then
cpt =3D cpt + 1
Tab(cpt) =3D Application.Evaluate("Ted!D" & i).Value
End If
Next i
MyCombo.List() =3D Tab
Cela doit certainement venir du Tab() ...
Si quelqu'un trouve l'erreur.
Je cherchais =E9galement comment je pourrais classer par
ordre alphab=E9tique ces valeurs justement.
cpt = 1 For i = 7 To 26 If Worksheets("Ted").Range("A" & i).Value <> Empty Then cpt = cpt + 1 Tab(cpt) = Application.Evaluate("Ted!D" & i).Value End If Next i
MyCombo.List() = Tab
Cela doit certainement venir du Tab() ... Si quelqu'un trouve l'erreur. Je cherchais également comment je pourrais classer par ordre alphabétique ces valeurs justement.
Thx de l'aide !!
Tim
bonjour,
un exemple en supposant que ton controle s'appelle toto
Dim tabl()
For i = 1 To 8
If Not IsEmpty(Cells(i, 1)) Then
ReDim Preserve tabl(cpt)
tabl(cpt) = Cells(i, 1)
cpt = cpt + 1
End If
Next
Me.toto.List = tabl
A+
Salut!
J'ai essayé de faire ceci afin de mette dans une liste
déroulante un ensemble de valeurs, mais apparement cela ne
fonctionne pas :(
cpt = 1
For i = 7 To 26
If Worksheets("Ted").Range("A" & i).Value <> Empty Then
cpt = cpt + 1
Tab(cpt) = Application.Evaluate("Ted!D" & i).Value
End If
Next i
MyCombo.List() = Tab
Cela doit certainement venir du Tab() ...
Si quelqu'un trouve l'erreur.
Je cherchais également comment je pourrais classer par
ordre alphabétique ces valeurs justement.
cpt = 1 For i = 7 To 26 If Worksheets("Ted").Range("A" & i).Value <> Empty Then cpt = cpt + 1 Tab(cpt) = Application.Evaluate("Ted!D" & i).Value End If Next i
MyCombo.List() = Tab
Cela doit certainement venir du Tab() ... Si quelqu'un trouve l'erreur. Je cherchais également comment je pourrais classer par ordre alphabétique ces valeurs justement.
Thx de l'aide !!
Tim
Tim
Thx ca marche
par contre il y a un prob avec tabl(cpt) = Application.Evaluate("Ted!C" & i).Value pour référencer la cellule "Ted!C" & i de la feuille Ted.
Au final la liste est vide :(
Thx ca marche
par contre il y a un prob avec
tabl(cpt) = Application.Evaluate("Ted!C" & i).Value
pour référencer la cellule "Ted!C" & i de la feuille Ted.
MsgBox "test1" cpt = 1 For i = 7 To 26 If Worksheets("Ted").Range("C" & i).Value <> Empty Then ReDim Preserve tabl(cpt) tabl(cpt) = Application.Evaluate("Ted!C" & i).Value cpt = cpt + 1 End If Next i
MsgBox "test1"
cpt = 1
For i = 7 To 26
If Worksheets("Ted").Range("C" & i).Value <> Empty Then
ReDim Preserve tabl(cpt)
tabl(cpt) = Application.Evaluate("Ted!C" & i).Value
cpt = cpt + 1
End If
Next i
MsgBox "test1" cpt = 1 For i = 7 To 26 If Worksheets("Ted").Range("C" & i).Value <> Empty Then ReDim Preserve tabl(cpt) tabl(cpt) = Application.Evaluate("Ted!C" & i).Value cpt = cpt + 1 End If Next i
MsgBox "test2"
MyCombo.List = tabl
MsgBox "test3"
anomymousA
re,
J'ai un peu allégé ton code au passage. Evaluate n'a pas grand interet.
Dim MyCombo As OLEObject Dim tabl()
Set MyCombo = ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:úlse, DisplayAsIcon:úlse, Left:65.25, Top:%8.75, Width:&2.5, Height:.5)
MyCombo.Name = "CodeAg"
MsgBox "test1" For i = 7 To 26 If Not IsEmpty(Worksheets("Ted").Cells(i, 3)) Then ReDim Preserve tabl(cpt) tabl(cpt) = Worksheets("Ted").Cells(i, 3).Value cpt = cpt + 1 End If Next i
MsgBox "test1" cpt = 1 For i = 7 To 26 If Worksheets("Ted").Range("C" & i).Value <> Empty Then ReDim Preserve tabl(cpt) tabl(cpt) = Application.Evaluate("Ted!C" & i).Value cpt = cpt + 1 End If Next i
MsgBox "test2"
MyCombo.List = tabl
MsgBox "test3"
re,
J'ai un peu allégé ton code au passage. Evaluate n'a pas grand interet.
Dim MyCombo As OLEObject
Dim tabl()
Set MyCombo = ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1",
Link:úlse, DisplayAsIcon:úlse, Left:65.25, Top:%8.75, Width:&2.5,
Height:.5)
MyCombo.Name = "CodeAg"
MsgBox "test1"
For i = 7 To 26
If Not IsEmpty(Worksheets("Ted").Cells(i, 3)) Then
ReDim Preserve tabl(cpt)
tabl(cpt) = Worksheets("Ted").Cells(i, 3).Value
cpt = cpt + 1
End If
Next i
MsgBox "test1"
cpt = 1
For i = 7 To 26
If Worksheets("Ted").Range("C" & i).Value <> Empty Then
ReDim Preserve tabl(cpt)
tabl(cpt) = Application.Evaluate("Ted!C" & i).Value
cpt = cpt + 1
End If
Next i
J'ai un peu allégé ton code au passage. Evaluate n'a pas grand interet.
Dim MyCombo As OLEObject Dim tabl()
Set MyCombo = ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:úlse, DisplayAsIcon:úlse, Left:65.25, Top:%8.75, Width:&2.5, Height:.5)
MyCombo.Name = "CodeAg"
MsgBox "test1" For i = 7 To 26 If Not IsEmpty(Worksheets("Ted").Cells(i, 3)) Then ReDim Preserve tabl(cpt) tabl(cpt) = Worksheets("Ted").Cells(i, 3).Value cpt = cpt + 1 End If Next i
MsgBox "test1" cpt = 1 For i = 7 To 26 If Worksheets("Ted").Range("C" & i).Value <> Empty Then ReDim Preserve tabl(cpt) tabl(cpt) = Application.Evaluate("Ted!C" & i).Value cpt = cpt + 1 End If Next i