Function ChoixDossier()
On Error Resume Next
With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = ActiveWorkbook.Path & "\"
.Show
If .SelectedItems.Count > 0 Then
ChoixDossier = .SelectedItems(1)
Else
ChoixDossier = ""
End If
End With
End Function
Sub EcrireBonjour()
Dim wbk As Workbook
Dim rep, nf As String
rep = ChoixDossier & "\"
nf = Dir(rep & "*.xlsx")
Application.ScreenUpdating = False
Do While Len(nf) > 0
Set wbk = Workbooks.Open(rep & nf)
With wbk
.Sheets(1).Range("A1").Formula = "Bonjour"
.Close True
End With
nf = Dir()
Loop
End Sub