Sub ArrondirAvecExcel()
numero = UserForm1.TextBox1.Value
Dim xlApp As Object ' Déclare la variable devant contenir la référence.
Set xlApp = CreateObject('excel.application')
With xlApp
.Visible = True
.workbooks.Open FileName:='C:\\input.xls'
End With
Set atrouve = xlApp.workbooks('input.xls').sheets('input').Range('A:A').Find(numero)
With xlApp
.Range(atrouve.Address).Select
End With
' Définition des variables
BV = xlApp.workbooks('input.xls').sheets('input').Range(atrouve.Address).Value
clients = xlApp.workbooks('input.xls').sheets('input').Range(atrouve.Address).offset(0, 1).Value
ville = xlApp.workbooks('input.xls').sheets('input').Range(atrouve.Address).offset(0, 2).Value
' Ferme Excel
xlApp.Quit
' Insert les variables dans Word
Selection.InsertAfter (BV)
Selection.InsertAfter (' ' & clients)
Selection.InsertAfter (' ' & ville)
End Sub