Bonjour,
Voici un premier essai à adapter faute d'informations precises :
'CODE A PLACER DANS LE MODULE DE LA FEUILLE 2
private sub worksheet_change(byval target as range)
dim r as range
set r = intersect(target, range("A1"))
if not r is nothing then
t = GetList(r.value)
with range("A3")
.currentregion.clearcontents
if not isempty(t) then .resize(ubound(t)) = application.transpose(t)
end with
end if
end sub
'CODE A PLACER DANS UN MODULE NORMAL
function GetList(KeyWord$)
dim t()
with sheets(1)
dl = .cells(.rows.count, 1).end(xlup).row
for i = 1 to dl
if .cells(i, 1) like Keyword & "*" then
n = n + 1: redim preserve t(1 to n): t(n) = .cells(i , 1).value
end if
next i
end with
if n > 0 then GetList = t
end function
Ce code prévoit que, lors d'un changement de valeur en A1 de la feuille n° 2, l'ensemble des correspondances trouvées en colonne 1 de la feuille n° 1 soit reporté en A3 de la feuille 2.
Les correspondances sont les valeurs qui commencent par le texte renseigné en A1.
Cdlt,