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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| Sub Ouvrir()
Dim jour1, mois1, an1, jour2, mois2, an2, site1, site2 As String
Dim Début As String
Dim Fin As String
Dim Découpe1() As String
Dim Découpe2() As String
site1 = Cells(2, 3).Value
site2 = Cells(2, 5).Value
Début = Cells(5, 3)
Fin = Cells(5, 5)
Découpe1 = Split(Début, "/")
jour1 = Découpe1(0)
mois1 = Découpe1(1)
an1 = Découpe1(2)
'Découpe2 = Split(Fin, "/")
'jour2 = Découpe2(0)
'mois2 = Découpe2(1)
'an2 = Découpe2(2)
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;D:\Users\bducharne\Documents\" & site1 & "\Le répertoire racine\Journal_" & an1 & "_" & mois1 & "_" & jour1 & "_00_01_00.csv", _
Destination:=Range("$A$1"))
.Name = "Journal_2017_07_19_00_01_00"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 28591
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Call Mise_en_page_tableau
ActiveSheet.Name = "Tableau"
Call Graphiques
End Sub |
Partager