Vous avez raison!
Désolé ...
Voici le fichier. Voyez la macro qui se trouve dans le code de l'onglet "general"
voici le code en auestionM
Private Sub Worksheet_Change(ByVal Target As Range)
' If Not Intersect(Target, Range("D1")) Is Nothing Then
' Range("W9:W11").ClearContents
' End If
ActiveSheet.Unprotect "obrat"
'UPDATE CHOICES IF LIST OF ROOMS CHANGED
Application.EnableEvents = False
Dim zone As Range
Set zone = Range("R8:R17")
Set zonetest = Range("C3:C500")
t = Target
Application.Undo
tOr = ActiveCell.Value
For Each c In zonetest
If c.Value = Target Then
c.Value = t
End If
Next c
ActiveCell = t
Application.EnableEvents = True
'AUTOMATICALLY FIT WITDH OF COLUMNS r +c
Application.ScreenUpdating = False
TCol = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
FTCol = UBound(TCol)
With Sheets("general")
.Columns("R").AutoFit
For Point = 0 To FTCol
If .Columns(TCol(Point)).ColumnWidth < 10.5 Then
.Columns(TCol(Point)).ColumnWidth = 10.5
End If
Next Point
End With
Application.ScreenUpdating = True
Application.ScreenUpdating = False
TCol = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
FTCol = UBound(TCol)
With Sheets("general")
.Columns("C").AutoFit
For Point = 0 To FTCol
If .Columns(TCol(Point)).ColumnWidth < 10 Then
.Columns(TCol(Point)).ColumnWidth = 10
End If
Next Point
End With
Application.ScreenUpdating = True
ActiveSheet.Range("a1").Select
ActiveSheet.Protect "obrat", True, True
End Sub
'Sub Evenement()
' Application.EnableEvents = True
'End Sub