Sub Click()
If IsError(Application.Caller) Then Exit Sub
Dim NomShape$
NomShape = Application.Caller
'---
Recherche NomShape
End Sub
Sub Recherche(cible)
Dim col%, ncol%, t, a(), i&, n&, j%
cible = CStr(cible)
col = 7 'colonne où se fait la recherche de cible
ncol = 11 'nombre de colonnes à copier >= col
t = Sheets("Clients").[A1].CurrentRegion.Resize(, ncol + 1)
ReDim a(1 To UBound(t), 1 To ncol)
For i = 2 To UBound(t)
If t(i, col) = cible Then
n = n + 1
For j = 1 To ncol
a(n, j) = t(i, j)
Next j
End If
Next i
'---restitution et mise en forme---
Application.ScreenUpdating = False
With [U7] '1ère cellule, à adapter
.Resize(Rows.Count - .Row + 1, ncol).Delete xlUp 'RAZ
End With
If n Then
With [U7].Resize(n, ncol)
.Value = a
.Interior.ColorIndex = 37 'bleu
.Borders(xlEdgeLeft).Weight = xlMedium
.Borders(xlEdgeRight).Weight = xlMedium
.Borders(xlEdgeBottom).Weight = xlMedium
.Borders(xlInsideVertical).Weight = xlThin
End With
End If
Columns.AutoFit 'ajustement largeur
End Sub