Recuperer n° ligne afin de modifier celle ci

bonjour

comment recuperer le numero de la ligne sur le classeur apres choix dans listbox afin de pouvoir effectué des modifications.

bouton planches a modifier

22suivi.xlsm (109.79 Ko)

Bonjour

En considérant que la référence est unique

Rajoutes la fin de la procédure Private Sub ListBox1_Click()

  Me.ComboBox1.Value = Me.ListBox1.List(Me.ListBox1.ListIndex, 7)
  TextBox10.Value = Me.ListBox1.ListIndex + 1

Dim Cel As Range
  Set Cel = Sheets("Inventaire Planches").Columns("E").Find(what:=Me.TextBox4, LookIn:=xlValues, lookat:=xlWhole)
  If Not Cel Is Nothing Then
    Me.TextBox11 = Cel.Row
  Else
    Me.TextBox11 = ""
  End If
  '---------------------------
'  Ligne = ActiveCell.Row
'  TextBox11.Value = Ligne
'  '--------------------------------

End Sub

oui si la référence est unique cela fonctionne, par contre des fois je vais avoir la même référence mais pour deux façon différente de travailler.

j'explore ta procédure voir si je peu adapter ton code

merci d'avoir regarder et si tu a une autre solution je prend

même s'il faut faire un AutoFilter et après afficher dans listbox

bonjour

en rajoutant des autofilter et ton code cela a l air de fonctionner

je continu et je vous tien au courant de la suite

Private Sub ListBox1_Click()

If Me.ListBox1.ListIndex <> -1 Then
With Sheets("Inventaire Planches").Range("A3")
.AutoFilter 1, Me.ListBox1.List(Me.ListBox1.ListIndex, 1 - 1)
.AutoFilter 2, Me.ListBox1.List(Me.ListBox1.ListIndex, 1)
.AutoFilter 3, Me.ListBox1.List(Me.ListBox1.ListIndex, 2)

End With
Me.TextBox2.Text = Me.ListBox1.List(Me.ListBox1.ListIndex, 1 - 1) & Me.ListBox1.List(Me.ListBox1.ListIndex, 1) & Me.ListBox1.List(Me.ListBox1.ListIndex, 2)
End If
For I = 3 To 6
Me.Controls("Textbox" & (I)).Value = Me.ListBox1.List(Me.ListBox1.ListIndex, (I))
Next I
For I = 8 To 9
Me.Controls("Textbox" & (I)).Value = Me.ListBox1.List(Me.ListBox1.ListIndex, (I))
Next I
 Me.ComboBox1.Value = Me.ListBox1.List(Me.ListBox1.ListIndex, 7)
TextBox10.Value = Me.ListBox1.ListIndex + 1

'---------------------------

Dim Cel As Range
  Set Cel = Sheets("Inventaire Planches").Columns("E").Find(what:=Me.TextBox4, LookIn:=xlValues, lookat:=xlWhole)
  If Not Cel Is Nothing Then
    Me.TextBox11 = Cel.Row
  Else
    Me.TextBox11 = ""
  End If

End Sub
Rechercher des sujets similaires à "recuperer ligne afin modifier celle"