macro lenta

17/07/2009 - 22:35 por fredy | Informe spam
buenas tardes

tengo una macro que sse mueve muy lento... haciendo el seguimientos con F8,
la parte que se aprecia mas lenta es :

If LM > 54.26 And LM <= 100 Then R = Cells(3, 4): G = Cells(4, 4): B =
Cells(5, 4): letra = 2
If LM > 100 And LM <= 200 Then R = Cells(3, 5): G = Cells(4, 5): B =
Cells(5, 5): letra = 0
If LM > 200 And LM <= 400 Then R = Cells(3, 6): G = Cells(4, 6): B =
Cells(5, 6): letra = 2
If LM > 400 And LM <= 800 Then R = Cells(3, 7): G = Cells(4, 7): B =
Cells(5, 7): letra = 2
If LM > 800 Then R = Cells(3, 8): G = Cells(4, 8): B = Cells(5, 8): letra = 2

Cells(J, i) = VOL
With Cells(J, i)

.Interior.Color = RGB(R, G, B)
.Font.ColorIndex = letra
End With


como se puede mejorar la ejecucion de esta macro?..

muchas gracias

Fredy
Anori, Colombia
 

Leer las respuestas

#1 fredy
18/07/2009 - 00:50 | Informe spam
hola
agregue la siguiente instruccion y mejora el proceso... claro que el
resultado del proceso solo se ve cuando termina todo el recorrido...

Application.ScreenUpdating = False

"fredy" wrote:

buenas tardes

tengo una macro que sse mueve muy lento... haciendo el seguimientos con F8,
la parte que se aprecia mas lenta es :

If LM > 54.26 And LM <= 100 Then R = Cells(3, 4): G = Cells(4, 4): B =
Cells(5, 4): letra = 2
If LM > 100 And LM <= 200 Then R = Cells(3, 5): G = Cells(4, 5): B =
Cells(5, 5): letra = 0
If LM > 200 And LM <= 400 Then R = Cells(3, 6): G = Cells(4, 6): B =
Cells(5, 6): letra = 2
If LM > 400 And LM <= 800 Then R = Cells(3, 7): G = Cells(4, 7): B =
Cells(5, 7): letra = 2
If LM > 800 Then R = Cells(3, 8): G = Cells(4, 8): B = Cells(5, 8): letra = 2

Cells(J, i) = VOL
With Cells(J, i)

.Interior.Color = RGB(R, G, B)
.Font.ColorIndex = letra
End With


como se puede mejorar la ejecucion de esta macro?..

muchas gracias

Fredy
Anori, Colombia



Preguntas similares