Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro runs slowly when performing formatting tasks 1

Status
Not open for further replies.

Haf

Mechanical
Nov 6, 2001
176
I have a macro that automatically opens a handfull of files, cuts and pastes selected data into a master worksheet, and then plots the data. When I run the macro, it does everything correctly.

Towards the end of the macro, I've programmed it to do some formatting on the plot to get it into presentation-quality format. When the macro runs, it does this formatting EXTREMELY slowly, and the screen begins flashing.

Why is this? I find it strange that the macro runs very quickly while cutting and pasting large amounts of data (thousands of rows from each worksheet), but then bogs down when performing simple formatting commands!

I should state that I am a beginner with Excel macros. At this point, I just use the "record" feature to write the macros and then only do minor tinkering on the VBA code, if necessary.

Thanks,

Haf
 
Replies continue below

Recommended for you

At the beginning of your macro:
Application.ScreenUpdating = False

At the end of your macro:
Application.ScreenUpdating = True

might help speed things up...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor