bonjour a tous je reviens vers vous aujourd hui car j ai creer un vba qui marche sur une feuille et je veux la meme sur un autre feuille et la pas moyen la base est enorme 539531 ligne et les combobox ne m affiche que les 2 premieres si quelqu un peu m aider
Dim i As Byte
Private Sub ComboBox1_Change()
End Sub
Private Sub CommandButton1_Click()
For i = 1 To 7: Controls("Textbox" & i) = "": Next (c est la que ca merde)
With Sheets("BASE")
For i = 2 To .Range("A539531").End(xlUp).Row
If .Range("A" & i) = ComboBox1 And .Range("B" & i) = ComboBox2 Then
TextBox1 = .Range("E" & i)
TextBox2 = .Range("I" & i)
TextBox3 = .Range("F" & i)
TextBox4 = .Range("G" & i)
End If
Next i
End With
If TextBox1 = "" Then MsgBox "pas trouve de reference correspondant a la recherche"
End Sub
Private Sub UserForm_Initialize()
With Sheets("BASE"): ComboBox1.List = Range(.[A2], .[A539531].End(xlUp)).Value: End With
With Sheets("BASE"): ComboBox2.List = Range(.[B2], .[B539531].End(xlUp)).Value: End With
End Sub
With Sheets("BASE"): ComboBox1.List = .Range(.[A2], .[A539531].End(xlUp)).Value: End With
With Sheets("BASE"): ComboBox2.List = .Range(.[B2], .[B539531].End(xlUp)).Value: End With
MERci de ton aide Pierre mais c est pas ca je vais d essayer je cherche aussi de mon cote quand je fait deboguage c'est au niveau next qui se souligne en jaune
voila le cobe que j ai copier qui marche bien que j ai voulu readapter pour ma feuille BASE compprenant 6 colonnes fabricant ref fabricant designation pAht sous famille unite et 539531 ligne mais trouve pas a reflechir
pour etre plus simple dans ine feuille base 6 colonne fabricant/ref fabricant/designation/pbht/unite/sous famille et 539531 ligne je voudrai combobox1 choix fabricant combobox2 choix ref fabricant cela me donne automatique textbox1 designation textbox2 pbht textbox3 unite textobox4 sous famille voila le code fait mais marche pas
Dim i As Byte
Private Sub ComboBox1_Change()
End Sub
Private Sub CommandButton1_Click()
For i = 1 To 7: Controls("Textbox" & i) = "": Next i
With Sheets("BASE")
For i = 2 To .Range("A539531").End(xlUp).Row
If .Range("A" & i) = ComboBox1 And .Range("B" & i) = ComboBox2 Then
TextBox1 = .Range("c" & i)
TextBox2 = .Range("d" & i)
TextBox3 = .Range("e" & i)
TextBox4 = .Range("f" & i)
End If
Next i
End With
If TextBox1 = "" Then MsgBox "pas trouve de reference correspondant a la recherche"
End Sub
Private Sub UserForm_Initialize()
With Sheets("BASE"): ComboBox1.List = .Range(.[A2], .[A539531].End(xlUp)).Value: End With
With Sheets("BASE"): ComboBox2.List = .Range(.[B2], .[B539531].End(xlUp)).Value: End With
End Sub
Voila un fichier joint pour suivre le fil pour le probleme des combobox quand la base a peut de ligne ca marche mais moi j ai une base a 539531 lignes d autre par le formule marche pour le bouton rechercher mais pas pour le bouton 4 un fois les combobox rempli les repons dans les textobox ne saffiche pas donc 2 problemes un peu d aide SVP selon dispo mais pourquoi
le mieux est de mettre en pièce jointe uniquement l'essentiel... là il y a 3 usf..... et quel est le code qui coince ??? désolé mais pas trop de temps en ce moment....