Sub Macro_recherchev()
[COLOR="green"]'Ouverture du fichier central de données : BASE COMMUNE CLIENT – PROSPECT – aaaammjj.xls[/COLOR]Dim Nom As String, Fichier_source As String, Destination As String
If (MsgBox("SVP ouvrez le fichier Excel contenant la base comptes/clients : BASE COMMUNE CLIENT – PROSPECT – 20090224.xls", _
vbInformation + vbOKOnly, "Ouverture fichier") = vbOK) Then
Nom = Application.GetOpenFilename(filefilter:="Fichier Excel (*.xls),*.xls")
Workbooks.Open Filename:=Nom
Fichier_source = Split(Nom, "\")(UBound(Split(Nom, "\")))
[COLOR="Green"]
'Set Destination = "Adresses erronées_macro.xls"[/COLOR]
Destination = ThisWorkbook.Name
[COLOR="green"]' Récupération du nom du contact dans le fichier central de données[/COLOR]
Windows(Destination).Activate
Range("B1").Select
ActiveCell.FormulaR1C1 = "Nom"
Range("B2").Select
[COLOR="green"]'ActiveCell.FormulaR1C1 = _
' "=VLOOKUP(RC1,'[BASE COMMUNE CLIENT – PROSPECT – 20090224 - LCHE.xls]annuaire'!R10C1:R10000C11,5,FALSE)"[/COLOR]
[COLOR="Red"]ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC1,'[Fichier_source]annuaire'!R10C1:R10000C11,5,FALSE)"[/COLOR]
Range("B2").Select
Selection.AutoFill Destination:=Range("B2:B500"), Type:=xlFillDefault
Range("B2:B500").Select