Hi
The code below runs EXTREMELY slow. Somebody know the reason?
The code below runs EXTREMELY slow. Somebody know the reason?
Code:
Sub WorksheetLoop()
Dim WS As Worksheet, co As Object
For Each WS In ActiveWorkbook.Worksheets
Set co = WS.Shapes.AddChart()
' ActiveSheet.Range("P2:AB2153").Select
'adjust to suit...
co.Top = 105
co.Left = 450
co.Width = 900
co.Height = 300
With co.Chart
.ChartType = xlLine
Do Until .SeriesCollection.Count = 0
.SeriesCollection(1).Delete
Loop
With .SeriesCollection.NewSeries
.Name = "=""Temperatura"""
.XValues = Range(Range("b2"), Range("b2").End(xlDown))
.Values = Range(Range("a1"), Range("a2").End(xlDown))
End With
With .SeriesCollection.NewSeries
.Name = "=""Niedozwolona"""
.XValues = Range(Range("b2"), Range("b2").End(xlDown))
.Values = Range(Range("c1"), Range("c2").End(xlDown))
End With
With .SeriesCollection.NewSeries
.Name = "=""Niedopuszczalna"""
.XValues = Range(Range("b2"), Range("b2").End(xlDown))
.Values = Range(Range("d1"), Range("d2").End(xlDown))
End With
End With
Set co = Nothing
Debug.Print "Processed: " & WS.Name
Next WS
End Sub