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
|
Sub traitement_feuille(f_travail As Worksheet)
Dim num_ligne As Integer, t_travail As Worksheet
Dim myrange As Range
'installe la colonne des temps
f_travail.Activate
f_travail.Cells(1, 1) = "Temps"
For num_ligne = 2 To derniere_ligne(t_travail)
f_travail.Cells(num_ligne, 1) = num_ligne - 2
Next
'graph
'f_travail.Cells(1, 1).Select
'Selection.CurrentRegion.Select
Set myrange = ActiveSheet.Cells(1, 1).CurrentRegion
'Charts.Add
Application.CutCopyMode = False
ActiveChart.ChartWizard _
Source:=Sheets(f_travail).Range(myrange.Address), _
Gallery:=xlXYScatterSmoothNoMarkers, Format:=4, PlotBy:=xlColumns, _
CategoryLabels:=1, SeriesLabels:=1, HasLegend:=1, _
Title:=f_travail, CategoryTitle:="", _
ValueTitle:="", ExtraTitle:=""
End Sub
Function derniere_ligne(f_travail) As Integer
Dim num_col As Integer, num_ligne As Integer
num_ligne = 0
For num_col = 1 To ActiveSheet.Cells(1, 10000).End(xlToLeft).Column
If ActiveSheet.Cells(100000, num_col).End(xlUp).Row > num_ligne Then
num_ligne = ActiveSheet.Cells(100000, num_col).End(xlUp).Row
End If
Next
derniere_ligne = num_ligne
End Function |
Partager