Bonjour,
Afin de récupérer des données stockées dans ma feuille excel dans mes textbox j'utilise le code suivant:
PREMIER USEform permettant de saisir l'identifiant et de lancer la recherche:
Option Explicit
Dim C As Range, MonDIco As Object, i As Byte, temp
Private Sub ComboBox1_Change()
End Sub
Public Sub CommandButton1_Click()
With UserForm4
Set C = Worksheets("Liste_MO_E_MT").Columns("B").Find(What:=ComboBox1)
If Not C Is Nothing Then
'MsgBox (C)
.ComboBox1 = ComboBox1 // c'est ici que j'ai un message d'erreur Membre de méthode ou de données introuvable!!!
For i = 1 To 8
.Controls("TextBox" & i) = C.Offset(, i - 1)
Next i
End If
End With
Unload Me
UserForm4.Show 0
End Sub
Public Sub UserForm3_Initialize()
Set MonDIco = CreateObject("Scripting.Dictionary")
For Each C In [noms]
If Not MonDIco.Exists(C.Value) Then MonDIco.Add C.Value, C.Value
Next C
temp = MonDIco.items
Me.ComboBox1.List = temp
End Sub
Deuxième userform avec des textBox pour récupérer les données:
Option Explicit
Dim C As Range, MonDIco As Object, i As Byte, temp
Public Sub ComboBox1_Change()
Set C = Sheets("Liste_MO_E_MT").Columns("B").Find(What:=ComboBox1)
If Not C Is Nothing Then
For i = 1 To 8
Controls("TextBox" & i) = C.Offset(, i - 1)
Next i
End If
End Sub
Public Sub UserForm4_Initialize()
Set MonDIco = CreateObject("Scripting.Dictionary")
For Each C In [noms]
If Not MonDIco.Exists(C.Value) Then MonDIco.Add C.Value, C.Value
Next C
temp = MonDIco.items
Me.ComboBox1.List = temp
End Sub
En sachant que j'utilise déjà ce code pour effectuer la même opération dans la même application, et sa marche sans problème. Merci d'avance pour votre aide !
Afin de récupérer des données stockées dans ma feuille excel dans mes textbox j'utilise le code suivant:
PREMIER USEform permettant de saisir l'identifiant et de lancer la recherche:
Option Explicit
Dim C As Range, MonDIco As Object, i As Byte, temp
Private Sub ComboBox1_Change()
End Sub
Public Sub CommandButton1_Click()
With UserForm4
Set C = Worksheets("Liste_MO_E_MT").Columns("B").Find(What:=ComboBox1)
If Not C Is Nothing Then
'MsgBox (C)
.ComboBox1 = ComboBox1 // c'est ici que j'ai un message d'erreur Membre de méthode ou de données introuvable!!!
For i = 1 To 8
.Controls("TextBox" & i) = C.Offset(, i - 1)
Next i
End If
End With
Unload Me
UserForm4.Show 0
End Sub
Public Sub UserForm3_Initialize()
Set MonDIco = CreateObject("Scripting.Dictionary")
For Each C In [noms]
If Not MonDIco.Exists(C.Value) Then MonDIco.Add C.Value, C.Value
Next C
temp = MonDIco.items
Me.ComboBox1.List = temp
End Sub
Deuxième userform avec des textBox pour récupérer les données:
Option Explicit
Dim C As Range, MonDIco As Object, i As Byte, temp
Public Sub ComboBox1_Change()
Set C = Sheets("Liste_MO_E_MT").Columns("B").Find(What:=ComboBox1)
If Not C Is Nothing Then
For i = 1 To 8
Controls("TextBox" & i) = C.Offset(, i - 1)
Next i
End If
End Sub
Public Sub UserForm4_Initialize()
Set MonDIco = CreateObject("Scripting.Dictionary")
For Each C In [noms]
If Not MonDIco.Exists(C.Value) Then MonDIco.Add C.Value, C.Value
Next C
temp = MonDIco.items
Me.ComboBox1.List = temp
End Sub
En sachant que j'utilise déjà ce code pour effectuer la même opération dans la même application, et sa marche sans problème. Merci d'avance pour votre aide !