Bonjour un test.
Si l'equipement selectionné est celui de la ligne 2 alors prévious inopérant.
Test -project (1).xlsm
Bonjour,
ça ne marche pas, le fichier joint c'est le fichier d'origine, il n'y a pas de code supplémentaire????
Bizarre chez moi çà fonctionne si la ligne 2 est selectionnée alors prévious ne remonte pas à la ligne 1
Pour les lignes supplémentaires :
Private Sub CommandButton1_Previous_Click()
Dim vals As Range
With ThisWorkbook.Sheets("Filtered Data SAP")
If TextBox_EquipementSAP.Value = 100048823 Then
Exit Sub
Else
For Each vals In .Range("A2", .Cells(Rows.Count, "A").End(xlUp)) ' Read the value in colum A
If vals.Value = Me.TextBox_EquipementSAP.Value Then
vals.Offset(-1, 0).Select ' Selection the upper line
Me.TextBox_EquipementSAP.Value = Selection.Value ' Displays the value of a previous line (up)
Exit For
End If
Next vals
End If
End With