Private Sub CommandButton3_Click() 'supprim
' ATTENTION
' Les variables de type Integer sont stockées sous la forme de nombres de 16 bits (2 octets)
'dont la valeur est comprise entre -32 768 et 32 767
Dim VarReponse As String 'L as long
Dim L As Long
Dim Poste As String
L = ComboBox7.ListIndex + 2
Poste = Worksheets("bd").Cells(L, 1)
VarReponse = MsgBox("Effacer le poste n° " & Poste, vbYesNo, "Alerte")
If VarReponse = vbNo Then GoTo Fin:
With Worksheets("bd")
[COLOR=blue]Dim NextLig As Long[/COLOR]
[COLOR=blue]NextLig = Sheets("Modifications").Range("B" & Rows.Count).End(xlUp).Row + 1[/COLOR]
[COLOR=blue]' Copier la ligne dans modifications avant[/COLOR]
[COLOR=blue].Range("A" & L & ":BX" & L).Copy destination:=Sheets("Modifications").Range("B" & NextLig)[/COLOR]
[COLOR=blue]Sheets("Modifications").Range("A" & NextLig).Value = Now()[/COLOR]
[COLOR=blue]Sheets("Modifications").Rows(NextLig).Interior.ColorIndex = 3[/COLOR]
' On peut supprimer la ligne
.Rows(L).EntireRow.Delete Shift:=xlShiftUp
End With
Fin:
ModeUsf "C"
End Sub