bonjours a tous,
je revient a vous car j'ai une problème sur une macro
celle-ci me fait un graphique mais les date sur les abscisse sont fausse
c pourquoi je sollicite votre savoirs
voici le fichier et le code
Cijoint.fr - Service gratuit de dépôt de fichiers
je revient a vous car j'ai une problème sur une macro
celle-ci me fait un graphique mais les date sur les abscisse sont fausse
c pourquoi je sollicite votre savoirs
voici le fichier et le code
Cijoint.fr - Service gratuit de dépôt de fichiers
Sub Temperature_plage_date()
Sheets("graph.plage de date").Visible = True
Sheets("graph.plage de date").Select
Set F1 = Worksheets(Feuil12.Name)
Application.ScreenUpdating = False
On Error Resume Next
F1.Shapes("Graphique1").Delete
Dim Plage As Range
If Feuil1.TextBox1 = "" Or Feuil1.TextBox2 = "" Then Exit Sub
With Feuil3
For k = 2 To .[A1048576].End(3).Row
If CDate(.Cells(k, 1)) >= CDate(Feuil1.TextBox1) And CDate(.Cells(k, 1)) <= CDate(Feuil1.TextBox2) Then
If Plage Is Nothing Then
Set Plage = Union(.Cells(k, 3), .Cells(k, 13), .Cells(k, 5))
Else
Set Plage = Union(Plage, .Cells(k, 3), .Cells(k, 13), .Cells(k, 5))
End If
End If
Next
End With
If Plage Is Nothing Then MsgBox "Pas de données", vbExclamation, "Erreur" _
: Sheets("menu").Visible = True: Sheets("menu").Select _
: Sheets("graph.plage de date").Visible = False: Exit Sub
Charts.Add
With ActiveChart
.ChartType = xlLine
.SetSourceData Source:=Plage, PlotBy:=xlColumns
.Location Where:=xlLocationAsObject, Name:=F1.Name
End With
ActiveSheet.ChartObjects("Graphique1").Activate
ActiveChart.ChartArea.Select
derlin = Sheets("Données").Range("R1048576").End(xlUp).Row
ActiveChart.SeriesCollection(1).XValues = "='Données'!$R$2:$R$" & derlin
ActiveChart.Parent.Name = "Graphique1"
End Sub