#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default slow macro

I am using 2 macro for my workbook and they take very long (at least 5 mins).
Is there anyone who can help to see if there is anything to speed it up?
Appreciate it.

My workbook consist of many sheet, each of them requiring these 2.

1st
Sub prime()
Set myrange = Range("'Golden Asia Growth (D)'!Date, 'Golden Asia Growth
(D)'!Price")
For Each f In myrange
f.Offset(, 6).Value = f.Value
Next
End Sub


2nd:
Sub prime2()
Set myrange = Range("D2:E500")
For Each f In myrange
f.Offset(, 3).Value = f.Value
Next
End Sub



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default slow macro

Hi,

The 2 lines at the start and end of each sub should speed things up


Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

'your code

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


":)" wrote:

I am using 2 macro for my workbook and they take very long (at least 5 mins).
Is there anyone who can help to see if there is anything to speed it up?
Appreciate it.

My workbook consist of many sheet, each of them requiring these 2.

1st
Sub prime()
Set myrange = Range("'Golden Asia Growth (D)'!Date, 'Golden Asia Growth
(D)'!Price")
For Each f In myrange
f.Offset(, 6).Value = f.Value
Next
End Sub


2nd:
Sub prime2()
Set myrange = Range("D2:E500")
For Each f In myrange
f.Offset(, 3).Value = f.Value
Next
End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro - very slow run in 2003 murkaboris Excel Discussion (Misc queries) 3 September 28th 09 09:28 PM
Macro is very slow jlclyde Excel Discussion (Misc queries) 2 September 29th 08 04:43 PM
Macro Running Painfully Slow! bigV Excel Discussion (Misc queries) 5 May 31st 08 12:41 AM
Macro is amazingly SLOW...Need help anshu[_2_] Excel Discussion (Misc queries) 7 July 16th 07 01:03 PM
Why is this PageSetup Macro So Slow? [email protected] Excel Discussion (Misc queries) 6 July 19th 05 09:28 PM


All times are GMT +1. The time now is 02:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"