Optimizacion de codigo
Publicado por perla Marina (2 intervenciones) el 28/07/2018 00:04:53
Hola, que Tal
Soy nueva en vba queria ver si podrian porfavor echandome la mano revisando si esta parte de codigo es optimo porque desde que lo agregue mi grafica tarda 2 minutos en crearse.
gracias de antemano.
Soy nueva en vba queria ver si podrian porfavor echandome la mano revisando si esta parte de codigo es optimo porque desde que lo agregue mi grafica tarda 2 minutos en crearse.
gracias de antemano.
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
With objXLBook1.ActiveChart.SeriesCollection(1)
.HasDataLabels = True
Dim MiMatriz As Variant
Dim TempDay As Integer
MiMatriz = objXLBook1.Worksheets("Report").Range("D2:D" & xlLastRow)
TempDay = objXLBook1.Worksheets("Report").Range("D2:D2")
Dim i as Integer
Dim cont as Integer
i=1
cont= xlLastRow - 1
For i = 1 To xlLastRow - 1
With objXLBook1.ActiveChart.SeriesCollection(1).Points(i)
If TempDay <> MiMatriz(i, 1) Then
.HasDataLabel = True
.DataLabel.Text = MiMatriz(i, 1)
.DataLabel.Position = xlLabelPositionBelow
.DataLabel.Orientation = 60
Else
.HasDataLabel = True
.DataLabel.Text = ""
End If
End With
TempDay = MiMatriz(i, 1)
Next i
End With
Valora esta pregunta


0