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 macro takes 30+ seconds to do an autofit on only 1 out of the 3 sheets it is autofitting

hey, for some reason this macro is taking 30+ seconds to perform a font
change and autofit on the 2nd sheet in this workbook. sheets 1 and 3
are almost identical (in rows and columns) and those happen in about 1
second or less. i am not sure why the 2nd sheet (ReArranged - No
Formulas) is taking so much longer then any of the other ones. i was
able to determine that the 2nd sheet was taking longer by using
breakpoints in the debugging. any ideas why? the code is below:



'Change fonts and fix column widths
Dim sheetArray(3)
sheetArray(1) = "ReArranged"
sheetArray(2) = "ReArranged - No Formulas"
sheetArray(3) = "DO NOT USE"

For L = 1 To 3

Sheets(sheetArray(L)).Select
Cells.Select
With Selection.Font
.Name = "MS Sans Serif"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Cells.Select
Selection.Columns.AutoFit
Range("A1").Select

If sheetArray(L) = "DO NOT USE" Then
Columns("A:A").ColumnWidth = 6.5
End If

Next L

 
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 Takes 30 Seconds Plus to Save First Time [email protected] Excel Discussion (Misc queries) 0 April 22nd 08 02:43 PM
Saving takes 30 Seconds [email protected] Excel Discussion (Misc queries) 7 February 13th 08 03:01 AM
Copying single cell takes 15-20 seconds Jason Woodruff Excel Discussion (Misc queries) 2 August 15th 06 03:14 PM
macro takes 30+ seconds to do an autofit on only 1 of 3 sheets it is autofitting drdavidge Excel Worksheet Functions 1 July 13th 06 05:48 PM
Save takes seconds vs. SaveAs/Save As takes minutes Andrew H[_3_] Excel Programming 0 August 17th 04 07:17 PM


All times are GMT +1. The time now is 01:21 PM.

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"