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
|
Sub ImportText(FileName As Variant, PosImport As Range)
Dim QT As QueryTable
Set QT = ActiveSheet.QueryTables.Add(Connection:="TEXT;" & _
FileName, Destination:=Range("A1"))
With QT
.TextFileOtherDelimiter = ","
.TextFileSemicolonDelimiter = True
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.Refresh
End With
End Sub
Sub Macro1()
Dim FileName1 As Variant
Dim i As Integer
FileName1 = Application.GetOpenFilename("Fichier Texte (*.txt), *.txt", , _
"Sélectionnez un ou plusieurs fichiers", , True)
If IsArray(FileName1) Then
For i = 1 To UBound(FileName1)
ImportText FileName1(i), Range("A1")
Next
End If
Range("A2:A2469").Select
Selection.NumberFormat = "h:mm:ss"
Range(Cells(2, 2), Cells(20, 1)).Select
Selection.Replace What:=" C", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
'Démarrage Graph
CreationGraphe2
End Sub
Public Sub CreationGraphe2()
Dim MonGraphe As Chart, maplage As Range, MaSerie As Series, compteur As Long
Dim Mini As Single, Maxi As Single
Set maplage = Worksheets("Feuil1").Range(Cells(2, 2), Cells(20, 1))
ThisWorkbook.Charts.Add
MonGraphe.ChartType = xlXYScatter
MonGraphe.SetSourceData maplage, xlColumns
End Sub |
Partager