Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" a écrit dans le message de news:
BqtKe.77784$
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" & Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" <tryagain@hotmail.com> a écrit dans le message de news:
BqtKe.77784$Z52.434515@wagner.videotron.net...
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" & Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" a écrit dans le message de news:
BqtKe.77784$
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" & Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" a écrit dans le message de news:
BqtKe.77784$
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" & Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" <tryagain@hotmail.com> a écrit dans le message de news:
BqtKe.77784$Z52.434515@wagner.videotron.net...
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" & Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" a écrit dans le message de news:
BqtKe.77784$
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" & Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
Bonsoir LineBaker,
Est-ce que ce petit exemple génère une erreur chez toi, c'est l'équivalent
de ton code !
'-------------------------------
Sub Test()
Dim B As Variant
Dim L As Integer
Dim tabtemp As Variant
L = Range("a15000").End(xlUp).Row
tabtemp = Range("A2:K" & L).Value
For L = 1 To UBound(tabtemp, 1)
B = tabtemp(L, 1)
Next
End Sub
'-------------------------------
Salutations!
"Linebaker" a écrit dans le message de news:
sKvKe.32311$
Bonjour Michel,
Oui j'ai toujours le même message d'erreur.
Je suis avec Excel 2003.
Merci
"michdenis" a écrit dans le message de news:Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en
utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" a écrit dans le message de news:
BqtKe.77784$
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" &
Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
Bonsoir LineBaker,
Est-ce que ce petit exemple génère une erreur chez toi, c'est l'équivalent
de ton code !
'-------------------------------
Sub Test()
Dim B As Variant
Dim L As Integer
Dim tabtemp As Variant
L = Range("a15000").End(xlUp).Row
tabtemp = Range("A2:K" & L).Value
For L = 1 To UBound(tabtemp, 1)
B = tabtemp(L, 1)
Next
End Sub
'-------------------------------
Salutations!
"Linebaker" <tryagain@hotmail.com> a écrit dans le message de news:
sKvKe.32311$651.1402118@weber.videotron.net...
Bonjour Michel,
Oui j'ai toujours le même message d'erreur.
Je suis avec Excel 2003.
Merci
"michdenis" <michdenis@hotmail.com> a écrit dans le message de news:
ez8X52fnFHA.3288@TK2MSFTNGP09.phx.gbl...
Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en
utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" <tryagain@hotmail.com> a écrit dans le message de news:
BqtKe.77784$Z52.434515@wagner.videotron.net...
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" &
Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
Bonsoir LineBaker,
Est-ce que ce petit exemple génère une erreur chez toi, c'est l'équivalent
de ton code !
'-------------------------------
Sub Test()
Dim B As Variant
Dim L As Integer
Dim tabtemp As Variant
L = Range("a15000").End(xlUp).Row
tabtemp = Range("A2:K" & L).Value
For L = 1 To UBound(tabtemp, 1)
B = tabtemp(L, 1)
Next
End Sub
'-------------------------------
Salutations!
"Linebaker" a écrit dans le message de news:
sKvKe.32311$
Bonjour Michel,
Oui j'ai toujours le même message d'erreur.
Je suis avec Excel 2003.
Merci
"michdenis" a écrit dans le message de news:Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en
utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" a écrit dans le message de news:
BqtKe.77784$
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" &
Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
Bonsoir LineBaker,
Est-ce que ce petit exemple génère une erreur chez toi, c'est l'équivalent
de ton code !
'-------------------------------
Sub Test()
Dim B As Variant
Dim L As Integer
Dim tabtemp As Variant
L = Range("a15000").End(xlUp).Row
tabtemp = Range("A2:K" & L).Value
For L = 1 To UBound(tabtemp, 1)
B = tabtemp(L, 1)
Next
End Sub
'-------------------------------
Salutations!
"Linebaker" a écrit dans le message de news:
sKvKe.32311$
Bonjour Michel,
Oui j'ai toujours le même message d'erreur.
Je suis avec Excel 2003.
Merci
"michdenis" a écrit dans le message de news:Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en
utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" a écrit dans le message de news:
BqtKe.77784$
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" &
Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
Bonsoir LineBaker,
Est-ce que ce petit exemple génère une erreur chez toi, c'est l'équivalent
de ton code !
'-------------------------------
Sub Test()
Dim B As Variant
Dim L As Integer
Dim tabtemp As Variant
L = Range("a15000").End(xlUp).Row
tabtemp = Range("A2:K" & L).Value
For L = 1 To UBound(tabtemp, 1)
B = tabtemp(L, 1)
Next
End Sub
'-------------------------------
Salutations!
"Linebaker" <tryagain@hotmail.com> a écrit dans le message de news:
sKvKe.32311$651.1402118@weber.videotron.net...
Bonjour Michel,
Oui j'ai toujours le même message d'erreur.
Je suis avec Excel 2003.
Merci
"michdenis" <michdenis@hotmail.com> a écrit dans le message de news:
ez8X52fnFHA.3288@TK2MSFTNGP09.phx.gbl...
Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en
utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" <tryagain@hotmail.com> a écrit dans le message de news:
BqtKe.77784$Z52.434515@wagner.videotron.net...
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" &
Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
Bonsoir LineBaker,
Est-ce que ce petit exemple génère une erreur chez toi, c'est l'équivalent
de ton code !
'-------------------------------
Sub Test()
Dim B As Variant
Dim L As Integer
Dim tabtemp As Variant
L = Range("a15000").End(xlUp).Row
tabtemp = Range("A2:K" & L).Value
For L = 1 To UBound(tabtemp, 1)
B = tabtemp(L, 1)
Next
End Sub
'-------------------------------
Salutations!
"Linebaker" a écrit dans le message de news:
sKvKe.32311$
Bonjour Michel,
Oui j'ai toujours le même message d'erreur.
Je suis avec Excel 2003.
Merci
"michdenis" a écrit dans le message de news:Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en
utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" a écrit dans le message de news:
BqtKe.77784$
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" &
Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
BINGO
Ça fonctionne sans message d'erreur.
Si j'ai bien compris tu as rajouté une ligne (B = tabtemp(L, 1)) ?
MERCI
"michdenis" a écrit dans le message de news:Bonsoir LineBaker,
Est-ce que ce petit exemple génère une erreur chez toi, c'est
l'équivalent de ton code !
'-------------------------------
Sub Test()
Dim B As Variant
Dim L As Integer
Dim tabtemp As Variant
L = Range("a15000").End(xlUp).Row
tabtemp = Range("A2:K" & L).Value
For L = 1 To UBound(tabtemp, 1)
B = tabtemp(L, 1)
Next
End Sub
'-------------------------------
Salutations!
"Linebaker" a écrit dans le message de news:
sKvKe.32311$
Bonjour Michel,
Oui j'ai toujours le même message d'erreur.
Je suis avec Excel 2003.
Merci
"michdenis" a écrit dans le message de news:Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en
utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" a écrit dans le message de news:
BqtKe.77784$
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" &
Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
BINGO
Ça fonctionne sans message d'erreur.
Si j'ai bien compris tu as rajouté une ligne (B = tabtemp(L, 1)) ?
MERCI
"michdenis" <michdenis@hotmail.com> a écrit dans le message de news:
ehBFSIgnFHA.2484@TK2MSFTNGP15.phx.gbl...
Bonsoir LineBaker,
Est-ce que ce petit exemple génère une erreur chez toi, c'est
l'équivalent de ton code !
'-------------------------------
Sub Test()
Dim B As Variant
Dim L As Integer
Dim tabtemp As Variant
L = Range("a15000").End(xlUp).Row
tabtemp = Range("A2:K" & L).Value
For L = 1 To UBound(tabtemp, 1)
B = tabtemp(L, 1)
Next
End Sub
'-------------------------------
Salutations!
"Linebaker" <tryagain@hotmail.com> a écrit dans le message de news:
sKvKe.32311$651.1402118@weber.videotron.net...
Bonjour Michel,
Oui j'ai toujours le même message d'erreur.
Je suis avec Excel 2003.
Merci
"michdenis" <michdenis@hotmail.com> a écrit dans le message de news:
ez8X52fnFHA.3288@TK2MSFTNGP09.phx.gbl...
Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en
utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" <tryagain@hotmail.com> a écrit dans le message de news:
BqtKe.77784$Z52.434515@wagner.videotron.net...
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" &
Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
BINGO
Ça fonctionne sans message d'erreur.
Si j'ai bien compris tu as rajouté une ligne (B = tabtemp(L, 1)) ?
MERCI
"michdenis" a écrit dans le message de news:Bonsoir LineBaker,
Est-ce que ce petit exemple génère une erreur chez toi, c'est
l'équivalent de ton code !
'-------------------------------
Sub Test()
Dim B As Variant
Dim L As Integer
Dim tabtemp As Variant
L = Range("a15000").End(xlUp).Row
tabtemp = Range("A2:K" & L).Value
For L = 1 To UBound(tabtemp, 1)
B = tabtemp(L, 1)
Next
End Sub
'-------------------------------
Salutations!
"Linebaker" a écrit dans le message de news:
sKvKe.32311$
Bonjour Michel,
Oui j'ai toujours le même message d'erreur.
Je suis avec Excel 2003.
Merci
"michdenis" a écrit dans le message de news:Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en
utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" a écrit dans le message de news:
BqtKe.77784$
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" &
Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
BINGO
Ça fonctionne sans message d'erreur.
Si j'ai bien compris tu as rajouté une ligne (B = tabtemp(L, 1)) ?
MERCI
"michdenis" a écrit dans le message de news:Bonsoir LineBaker,
Est-ce que ce petit exemple génère une erreur chez toi, c'est
l'équivalent de ton code !
'-------------------------------
Sub Test()
Dim B As Variant
Dim L As Integer
Dim tabtemp As Variant
L = Range("a15000").End(xlUp).Row
tabtemp = Range("A2:K" & L).Value
For L = 1 To UBound(tabtemp, 1)
B = tabtemp(L, 1)
Next
End Sub
'-------------------------------
Salutations!
"Linebaker" a écrit dans le message de news:
sKvKe.32311$
Bonjour Michel,
Oui j'ai toujours le même message d'erreur.
Je suis avec Excel 2003.
Merci
"michdenis" a écrit dans le message de news:Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en
utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" a écrit dans le message de news:
BqtKe.77784$
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" &
Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
BINGO
Ça fonctionne sans message d'erreur.
Si j'ai bien compris tu as rajouté une ligne (B = tabtemp(L, 1)) ?
MERCI
"michdenis" <michdenis@hotmail.com> a écrit dans le message de news:
ehBFSIgnFHA.2484@TK2MSFTNGP15.phx.gbl...
Bonsoir LineBaker,
Est-ce que ce petit exemple génère une erreur chez toi, c'est
l'équivalent de ton code !
'-------------------------------
Sub Test()
Dim B As Variant
Dim L As Integer
Dim tabtemp As Variant
L = Range("a15000").End(xlUp).Row
tabtemp = Range("A2:K" & L).Value
For L = 1 To UBound(tabtemp, 1)
B = tabtemp(L, 1)
Next
End Sub
'-------------------------------
Salutations!
"Linebaker" <tryagain@hotmail.com> a écrit dans le message de news:
sKvKe.32311$651.1402118@weber.videotron.net...
Bonjour Michel,
Oui j'ai toujours le même message d'erreur.
Je suis avec Excel 2003.
Merci
"michdenis" <michdenis@hotmail.com> a écrit dans le message de news:
ez8X52fnFHA.3288@TK2MSFTNGP09.phx.gbl...
Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en
utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" <tryagain@hotmail.com> a écrit dans le message de news:
BqtKe.77784$Z52.434515@wagner.videotron.net...
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" &
Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci
BINGO
Ça fonctionne sans message d'erreur.
Si j'ai bien compris tu as rajouté une ligne (B = tabtemp(L, 1)) ?
MERCI
"michdenis" a écrit dans le message de news:Bonsoir LineBaker,
Est-ce que ce petit exemple génère une erreur chez toi, c'est
l'équivalent de ton code !
'-------------------------------
Sub Test()
Dim B As Variant
Dim L As Integer
Dim tabtemp As Variant
L = Range("a15000").End(xlUp).Row
tabtemp = Range("A2:K" & L).Value
For L = 1 To UBound(tabtemp, 1)
B = tabtemp(L, 1)
Next
End Sub
'-------------------------------
Salutations!
"Linebaker" a écrit dans le message de news:
sKvKe.32311$
Bonjour Michel,
Oui j'ai toujours le même message d'erreur.
Je suis avec Excel 2003.
Merci
"michdenis" a écrit dans le message de news:Bonjour LineBaker,
Quel est ta version d'excel. Sous excel 2003, ton code est bon.
Il doit y avoir un problème entre la déclaration de ta variable. J'ai
souvenir qu'excel se comporte différemment selon les versions
dans les déclarations des tableaux ou des variables "as variant"
Dim tabtemp As Variant
et cette ligne de code juste au dessus ...
tabtemp = .Range("A2:K" & L).Value
Essaie ta procédure mais sans définir le type à ta Variable , en
utilisant
ces 2 lignes de code. As-tu toujours un message d'erreur
?
Dim tabtemp
tabtemp = .Range("A2:K" & L)
Salutations
"Linebaker" a écrit dans le message de news:
BqtKe.77784$
Bonjour à vous tous,
Dans le code qui suit, j'ai une erreur que je ne sais comment corriger.
Est-ce que quelqu'un peut m'aider ?
Option Explicit
Option Compare Text
Private TabPlage As Variant
Private Sub UserForm_Initialize()
Dim i As Integer
Dim ColBase1 As New Collection
Dim Item As Variant
Dim X As Byte
For X = 1 To 3
Me.Controls("ComboBox" & X).Style = fmStyleDropDownList
Next
With Sheets("Feuil1")
TabPlage = .Range("A2:C" & .Range("A65536").End(xlUp).Row)
End With
On Error Resume Next
For i = 1 To UBound(TabPlage)
ColBase1.Add TabPlage(i, 1), TabPlage(i, 1)
Next
On Error GoTo 0
For Each Item In ColBase1
Me.ComboBox1.AddItem Item
Next
End Sub
Private Sub ComboBox1_Change()
ComboBoxing 2
End Sub
Private Sub ComboBox2_Change()
ComboBoxing 3
End Sub
Private Sub ComboBox3_Change()
Dim L As Integer
Dim tabtemp As Variant
With Worksheets("Feuil1")
L = .Range("a15000").End(xlUp).Row
tabtemp = .Range("A2:K" & L).Value
End With
For L = 1 To UBound(tabtemp, 1) 'l'erreur 13 se trouve ici
If tabtemp(L, 1) = CLng(ComboBox3.Value) Then
ListBox1.AddItem tabtemp(L, 1)
ListBox2.AddItem tabtemp(L, 2)
ListBox3.AddItem tabtemp(L, 3)
ListBox4.AddItem tabtemp(L, 4)
ListBox5.AddItem tabtemp(L, 8)
ListBox6.AddItem tabtemp(L, 6)
ListBox7.AddItem tabtemp(L, 7)
ListBox8.AddItem tabtemp(L, 5)
End If
Next L
End Sub
Private Sub ComboBoxing(Num As Byte)
Dim i As Integer
Dim ColBaseX As New Collection
Dim Item As Variant
Dim X As Byte
For X = Num To 3
Me.Controls("ComboBox" & X).Clear
Next
On Error Resume Next
For i = 1 To UBound(TabPlage)
If CStr(TabPlage(i, Num - 1)) = CStr(Me.Controls("ComboBox" &
Num -
1)) Then
ColBaseX.Add TabPlage(i, Num), CStr(TabPlage(i, Num))
End If
Next
On Error GoTo 0
For Each Item In ColBaseX
Me.Controls("ComboBox" & Num).AddItem Item
Next
End Sub
Merci