LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Can you help me figure out why my macro is running slowly?

I have a macro that is reading data sequentially from 150 text files.
Sometimes the entire process takes 15-20 seconds, and other times it
takes a couple of minutes. I can't figure out why there is such a
time variance in the amount of time it takes to run.

Here are the main parts of the process:

1. Declare variables including dynamic arrays.
2. Size the arrays to 1000 elements using ReDim.
3. Create new Excel workbook.
4. Open first text file and read values into the arrays. Usually
there are 100 values per array.
5. Resize the arrays to 100 elements (or however many are necessary,
always much less than 1000) using ReDim.
6. Close the text file.
7. Perform some computations.
8. Set Application.ScreenUpdating = False
9. Write computed values to the workbook opened in step 3.
10. Format cells.
11. Loop through steps 4 to 10 until all text files have been
processed.
12. A little more formatting.
13. Save workbook and end macro.

If you have any suggestions, please let me know. Thanks.

 
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
EXCEL macros running much more slowly in EXCEL 2007 vs. 2003 Eric Grove New Users to Excel 1 January 14th 10 08:17 PM
HOW DO I COPY A TOTAL FIGURE FROM 1 SHEET TO NEXT ADDING RUNNING T SANDRA Excel Worksheet Functions 0 October 8th 07 01:27 PM
WHY the same macro runs so slowly on a different but faster comput Jerry Excel Discussion (Misc queries) 2 August 15th 07 10:30 PM
Paste code running extremely slowly... KR Excel Programming 1 August 3rd 05 03:26 PM
Macros in Excel 2000 running very slowly cottage6 Excel Programming 3 January 6th 05 09:43 PM


All times are GMT +1. The time now is 09:22 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"