Dim memValeur, memLargeur 'mémorise les variables
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i%, c As Range
If Intersect(Target, Rows(7)) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Application.EnableEvents = False 'désactive les évènements
Application.Undo 'annule les modifications
'---mémorisations---
memValeur = Range("A7", Cells(7, Columns.Count).End(xlToLeft)).Value
ReDim memLargeur(1 To Application.CountA(memValeur))
For i = 1 To UBound(memLargeur)
memLargeur(i) = Cells(7, i).ColumnWidth
Next
Application.Undo 'rétablit les modifications
Application.EnableEvents = True 'réactive les évènements
For Each c In Range("A7", Cells(7, Columns.Count).End(xlToLeft))
If IsNumeric(CStr(c)) Then If c >= 0 And c <= 255 Then c.ColumnWidth = c
Next
End Sub
Sub Annuler()
Dim Valeur, Largeur(), i%, c As Range
If Not IsArray(memLargeur) Then Exit Sub
'---mémorisations temporaires---
Valeur = Range("A7", Cells(7, Columns.Count).End(xlToLeft)).Value
ReDim Largeur(1 To Application.CountA(Valeur))
For i = 1 To UBound(Largeur)
Largeur(i) = Cells(7, i).ColumnWidth
Next
'---annulation---
Application.ScreenUpdating = False
Application.EnableEvents = False 'désactive les évènements
Rows(7) = Empty 'RAZ
[A7].Resize(, Application.CountA(memValeur)) = memValeur
For i = 1 To UBound(memLargeur)
If memLargeur(i) >= 0 And memLargeur(i) <= 255 Then Cells(7, i).ColumnWidth = memLargeur(i)
Next
Application.EnableEvents = True 'réactive les évènements
'---nouvelles mémorisations---
memValeur = Valeur
ReDim memLargeur(1 To Application.CountA(memValeur))
For i = 1 To UBound(memLargeur)
memLargeur(i) = Largeur(i)
Next
End Sub