Voilà le petit programme...
au cas où cela vs aide...
´marche mais: pour les dates dont le jour est un nombre inférieur à 12
´il faut d´abord rentrer le mois puis le jour ds la boite de dialogue
Private Sub CommandButton1_Click()
´remplissage de la boite de dialogue
If UserForm1.TextBox1.Text = " " Then
MsgBox " Vous n´avez rien saisi," & Chr(10) & " Recommencez!"
Exit Sub
Else
Range("D1").Value = UserForm1.TextBox1.Text
ActiveCell.Offset(1, 0).Select
End If
If UserForm1.TextBox2.Text = " " Then
MsgBox " Vous n´avez rien saisi," & Chr(10) & " Recommencez!"
Exit Sub
Else
Range("E1").Value = UserForm1.TextBox2.Text
ActiveCell.Offset(1, 0).Select
End If
´ Tri
Columns("A:A").Select
Selection.NumberFormat = " yyyy/mm/dd"
Range("D1:E1").NumberFormat = " dd/mm/yyyy"
Range("A:C").AutoFilter Field:=1, Criteria1:=">=" & Range("D2").Value, Operator:=xlAnd, Criteria2:="<=" & Range("E2").Value
Sheets("Feuil1").AutoFilter.Range.Copy Sheets("Feuil2").Range("A1:C1")
Worksheets("Feuil2").Range("1:1").Delete shift:=xlShiftToLeft
Worksheets("Feuil2").Columns("A").Delete shift:=xlShiftToLeft
´Unload Me
´realisation du graphique
Sheets("Feuil2").Select
Columns("A:B").Select
Charts.Add
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=Sheets("Feuil2").Range("A:B"), PlotBy _
:=xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet
With ActiveChart
. HasTitle = True
. ChartTitle.Characters.Text = " Variation du débit"
. Axes(xlCategory, xlPrimary).HasTitle = True
. Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = " Heures"
. Axes(xlValue, xlPrimary).HasTitle = True
. Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = " Débit"
End With
With ActiveChart.Axes(xlCategory)
. HasMajorGridlines = True
. HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
. HasMajorGridlines = True
. HasMinorGridlines = False
End With
ActiveChart.HasLegend = False
ActiveChart.Axes(xlCategory).MajorGridlines.Select
With ActiveChart.Axes(xlCategory)
. CrossesAt = 1
. TickLabelSpacing = 30
. TickMarkSpacing = 60
. AxisBetweenCategories = True
. ReversePlotOrder = False
End With
ActiveChart.Axes(xlCategory).Select
With Selection.Border
. Weight = xlHairline
. LineStyle = xlAutomatic
End With
With Selection
. MajorTickMark = xlOutside
. MinorTickMark = xlCross
. TickLabelPosition = xlNextToAxis
End With
With Selection.TickLabels
. Alignment = xlCenter
. Offset = 100
. Orientation = 45
End With
End Sub