View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
PCLIVE PCLIVE is offline
external usenet poster
 
Posts: 1,311
Default Making the macro's execution faster

Try adding to your code.

Application.ScreenUpdating = False '(add to the top of your code)

<Your Code

Application.ScreenUpdating = True '(add to the bottom of your code)


HTH,
Paul


"dspilberg" wrote in message
...
I would like to know if there is a way to make my macro's execution faster.
It follows that during its execution I work in 2 different worksheets in
parallel. So it shows me in the screen each active sheet every line the
macro
runs. I tried occulting the sheets (in which the macro works) but then the
macro did not run. Is there a way to occult the sheet without having
problem
with its exectuion?

Is there any other way to make it faster?

I built the simple following macro just to illustrate the problem.

Thanks in advance. I really appreciate any tip or attempt.

Daniel (Brazil)

Sub Macro1()
'
Sheets("Plan1").Select
Range("a1").Select
Range("a1") = "1"
Sheets("Plan2").Select
Range("a1").Select
Range("a1") = "1"
Sheets("Plan1").Select
cont = 0

For a = 1 To 500
ActiveCell = Cells(1, 1).Value + cont
ActiveCell.Offset(1, 0).Select
Sheets("Plan2").Select
ActiveCell = Cells(1, 1).Value + cont
ActiveCell.Offset(1, 0).Select
Sheets("Plan1").Select
cont = cont + 1
Next a

End Sub