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 60 61
| Sub Filter_trailer_performance()
''' Define the serial number
Sheets("statistic").Select
Nb_lines = WorksheetFunction.CountA(Range("C:C"))
Range("D44").Select
Selection.AutoFilter
Call reshape
''' Define Sr.
Sheets("statistic").Select
sr = 0
Cells(45, 2) = sr
For i = 0 To Nb_lines
Cells(45 + i, 2) = sr
If Not Cells(45 + i, 4) = 0 Then
sr = sr + 1
Cells(45 + i, 2) = sr
End If
Next i
Range("D44").Select
Selection.AutoFilter
ActiveSheet.Range("$B$43:$E$" & 43 + Nb_lines).AutoFilter Field:=3, Criteria1:="<>"
Call reshape
Call reshape_size
End Sub
Sub reshape()
''' Reshape the chart
Sheets("SUMMARY").Select
ActiveSheet.Shapes.Range(Array("Picture 20")).Select
Selection.ShapeRange.ScaleHeight 1#, msoTrue, msoScaleFromTopLeft
Selection.ShapeRange.ScaleWidth 1#, msoTrue, msoScaleFromTopLeft
End Sub
Sub reshape_size()
Sheets("Summary").Select
ActiveSheet.Shapes.Range(Array("Picture 20")).Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.ScaleHeight 0.7, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleWidth 0.7, msoFalse, msoScaleFromTopLeft
End Sub |
Partager