Private Sub BtnLister_Click()
Dim lig As Long ', lig2 As Long, col2 As Long
Dim c As Range, erreurs As Long
Application.ScreenUpdating = False
' recup liste locaux
[E1].Resize(1, [local].Cells.Count) = Application.Transpose([local])
For lig = 2 To Cells(Rows.Count, 1).End(xlUp).Row
' recup colonne local
Set c = Rows(1).Find(Cells(lig, 3), LookIn:=xlValues, lookat:=xlWhole)
If c Is Nothing Then
' local inconnu
erreurs = erreurs + 1
Cells(lig, 3).Interior.ColorIndex = vbRed
Else
' ajouter nom
Cells(Cells(Rows.Count, c.Column).End(xlUp).Row + 1, c.Column) = Cells(lig, 1) & " " & Cells(lig, 2)
End If
Next lig
Application.ScreenUpdating = True
If erreurs > 0 Then MsgBox (erreurs & " locaux inconnus surlignés en rouge.")
End Sub