Selection rows +4 ligne dans userform

Résolu
patbl Messages postés 84 Statut Membre -  
patbl Messages postés 84 Statut Membre -
Bonjour,

je voudrais selectionner la ligne de mon combobox mais c'est la 4è
dans l'userform
 Dim Cell As Range


ComboBox1.Clear
For Each Cell In Sheets("pat").Range("A4:A" & Range("A65536").End(xlUp).Row)

 ComboBox1 = Cell
    
 If (ComboBox1.ListIndex) = -1 Then _
      ComboBox1.AddItem Cell
      
Next Cell
end sub


dans le combobox
rows((ComboBox1.ListIndex) + 4).Select


ceci passe à la 2eme ligne or que je voudrais selectionne ma 4eme
je suis sur excel 2000



--

merci de votre aide à bientôt
patricia

1 réponse

  1. patbl Messages postés 84 Statut Membre 4
     
    Dim a As Integer
    Dim cherche As String
    cherche = ComboBox1.Value
    a = Cells.Find(What:=cherche, LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlNext).Row
    rows(a).Select
    0