Bonsoir,
j'ai une macro de recherche ( emprunté sur le forum et modifié à ma base de données, merci à l'auteur ), mais ma recherche se fait sur la colonne B, alors que je voudrais qu'elle se fasse sur la colonne A. Si un bon samaritain pourrait m'aider à résoudre ce probème, ça serait chouette.
Option Explicit
Dim Onyx As Range, Tableau As Range
Private Sub CommandButton1_Click()
Unload UserForm1
End Sub
Private Sub ComboBox1_Change()
Dim lgn&
lgn = ComboBox1.ListIndex + 1
With Tableau
Prenom.Value = .Cells(lgn, 2)
RaisonSociale.Value = .Cells(lgn, 3)
Intervenant.Value = .Cells(lgn, 4)
Statut.Value = .Cells(lgn, 5)
Objet.Value = .Cells(lgn, 6)
ArrPref.Value = .Cells(lgn, 7)
ArrCab.Value = .Cells(lgn, 8)
Responsable.Value = .Cells(lgn, 9)
ServSaisi.Value = .Cells(lgn, 10)
DateSaisie.Value = .Cells(lgn, 11)
RelanceService.Value = .Cells(lgn, 12)
DateRelance.Value = .Cells(lgn, 13)
InstClasse.Value = .Cells(lgn, 15)
DateReponse.Value = .Cells(lgn, 16)
ComClassement.Value = .Cells(lgn, 17)
NomClassement.Value = .Cells(lgn, 18)
Commentaires.Value = .Cells(lgn, 19)
End With
End Sub
Private Sub CommandButton3_Click()
Dim lgn&
lgn = ComboBox1.ListIndex + 1
If lgn = 0 Then Exit Sub
With Tableau
.Cells(lgn, 2) = Prenom
.Cells(lgn, 3) = RaisonSociale
.Cells(lgn, 4) = Intervenant
.Cells(lgn, 5) = Statut
.Cells(lgn, 6) = Objet
.Cells(lgn, 7) = ArrPref
.Cells(lgn, 8) = ArrCab
.Cells(lgn, 9) = Responsable
.Cells(lgn, 10) = ServSaisi
.Cells(lgn, 11) = DateSaisie
.Cells(lgn, 12) = RelanceService
.Cells(lgn, 13) = DateRelance
.Cells(lgn, 15) = InstClasse
.Cells(lgn, 16) = DateReponse
.Cells(lgn, 17) = ComClassement
.Cells(lgn, 18) = NomClassement
.Cells(lgn, 19) = Commentaires
End With
Unload Me
End Sub
Private Sub UserForm_initialize()
Dim Plage As Range
With Worksheets("Base")
Set Onyx = .Range("A9")
Set Plage = .Range(Onyx, .Range("B65536").End(xlUp))
Set Tableau = Plage.Resize(, 11)
End With
ComboBox1.List = Plage.Value
End Sub
j'ai une macro de recherche ( emprunté sur le forum et modifié à ma base de données, merci à l'auteur ), mais ma recherche se fait sur la colonne B, alors que je voudrais qu'elle se fasse sur la colonne A. Si un bon samaritain pourrait m'aider à résoudre ce probème, ça serait chouette.
Option Explicit
Dim Onyx As Range, Tableau As Range
Private Sub CommandButton1_Click()
Unload UserForm1
End Sub
Private Sub ComboBox1_Change()
Dim lgn&
lgn = ComboBox1.ListIndex + 1
With Tableau
Prenom.Value = .Cells(lgn, 2)
RaisonSociale.Value = .Cells(lgn, 3)
Intervenant.Value = .Cells(lgn, 4)
Statut.Value = .Cells(lgn, 5)
Objet.Value = .Cells(lgn, 6)
ArrPref.Value = .Cells(lgn, 7)
ArrCab.Value = .Cells(lgn, 8)
Responsable.Value = .Cells(lgn, 9)
ServSaisi.Value = .Cells(lgn, 10)
DateSaisie.Value = .Cells(lgn, 11)
RelanceService.Value = .Cells(lgn, 12)
DateRelance.Value = .Cells(lgn, 13)
InstClasse.Value = .Cells(lgn, 15)
DateReponse.Value = .Cells(lgn, 16)
ComClassement.Value = .Cells(lgn, 17)
NomClassement.Value = .Cells(lgn, 18)
Commentaires.Value = .Cells(lgn, 19)
End With
End Sub
Private Sub CommandButton3_Click()
Dim lgn&
lgn = ComboBox1.ListIndex + 1
If lgn = 0 Then Exit Sub
With Tableau
.Cells(lgn, 2) = Prenom
.Cells(lgn, 3) = RaisonSociale
.Cells(lgn, 4) = Intervenant
.Cells(lgn, 5) = Statut
.Cells(lgn, 6) = Objet
.Cells(lgn, 7) = ArrPref
.Cells(lgn, 8) = ArrCab
.Cells(lgn, 9) = Responsable
.Cells(lgn, 10) = ServSaisi
.Cells(lgn, 11) = DateSaisie
.Cells(lgn, 12) = RelanceService
.Cells(lgn, 13) = DateRelance
.Cells(lgn, 15) = InstClasse
.Cells(lgn, 16) = DateReponse
.Cells(lgn, 17) = ComClassement
.Cells(lgn, 18) = NomClassement
.Cells(lgn, 19) = Commentaires
End With
Unload Me
End Sub
Private Sub UserForm_initialize()
Dim Plage As Range
With Worksheets("Base")
Set Onyx = .Range("A9")
Set Plage = .Range(Onyx, .Range("B65536").End(xlUp))
Set Tableau = Plage.Resize(, 11)
End With
ComboBox1.List = Plage.Value
End Sub