Re : Modification de code VBA
Bonjour Robert,
Je ne vois que les codes suivants :
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
Set r = Intersect(Target, Range("F2:G" & Rows.Count), Me.UsedRange)
If r Is Nothing Then Exit Sub
Application.EnableEvents = False 'désactive les événements
For Each r In r 'si plusieurs cellules sont modifiées
With Cells(r.Row, "H")
If CStr(r) = "" Then
.Value = ""
Else
If InStr(.Text, CStr(r)) Then
.Value = Replace(.Text, CStr(r) & vbLf, "")
.Value = Replace(.Text, vbLf & CStr(r), "")
.Value = Replace(.Text, CStr(r), "")
Else
.Value = .Text & IIf(.Text = "", "", vbLf) & CStr(r)
End If
r = .Value
End If
r.EntireRow.AutoFit 'ajustement de la hauteur
End With
Next
Application.EnableEvents = True 'réactive les événements
End Sub
ET
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 3 Or Target.Row < 2 Or Target.Count <> 1 Then Exit Sub
If Target.Text <> "100%" Then Exit Sub
If MsgBox("Voulez vous l'archiver ?", _
vbYesNo + vbQuestion, "Archivage ligne " & Target.Row) = vbNo Then Exit Sub
With Target.EntireRow
.Resize(, 3).Copy Feuil4.Cells(Rows.Count, "A").End(xlUp).Offset(1)
.Delete: End With
End Sub
Mais je ne vois pas le Offset à 3 qui est a modifier...
Cordialement,