countryfan_nt
Well-known Member
- Joined
- May 19, 2004
- Messages
- 765
Hello friends, Hope all is well!
Strange thing, the below code works but Very slow. When I press the Esc button the code runs fast & smooth.
Please help me apply the Esc command within the code please.
Thank you So much in advance!
Strange thing, the below code works but Very slow. When I press the Esc button the code runs fast & smooth.
Please help me apply the Esc command within the code please.
Thank you So much in advance!
Code:
Sub B_REV()
Dim aSeries As Series
Application.ScreenUpdating = True
ActiveSheet.ChartObjects("Chart 9").Select
For Each aSeries In ActiveChart.SeriesCollection
Select Case UCase(aSeries.Name)
Case "REV"
Case Else
aSeries.Delete
End Select
Next aSeries
num_rows = Sheet6.Range("A1").CurrentRegion.Rows.Count - 1
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).XValues = Sheets("REV").Cells(2, 1)
ActiveChart.SeriesCollection(2).Values = Sheets("REV").Cells(2, 2)
For r = 2 To num_rows
Sheets("REV").Cells(r, 4) = Sheets("REV").Cells(r, 1)
Sheets("REV").Cells(r, 5) = Sheets("REV").Cells(r, 2)
ActiveChart.SeriesCollection(2).XValues = Sheets("REV").Cells(r, 4)
ActiveChart.SeriesCollection(2).Values = Sheets("REV").Cells(r, 5)
If Sheets("chart").Range("AJ1") = "True" Then
Application.Wait Now()
End If
Next r
ActiveChart.SeriesCollection(2).Delete
End Sub
Last edited: