1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Const rep_data = "G:\Plans\Formulaires"
Const sh_data = "ABCL"
Public Sub Recup_data()
Dim strPath As String
Dim strFile As String
Dim wrk As Workbook
Dim cel As String
Dim i As Integer
strFile = Dir(rep_data & "\" & "Formulaire_1.xlsx")
i = 0
Do While strFile <> ""
Set wrk = Workbooks.Open(rep_data & "\" & strFile)
i = i + 1
cel = wrk.Sheets(sh_data).Cells(1, 10).Value
tableau = Split(cel, ":")
dat = Trim(tableau(1))
ThisWorkbook.Sheets("Bilan").Cells(6, 2).Value = dat
wrk.Close True
strFile = Dir
Loop
End Sub |
Partager