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: 101
Default Excel 2007, changing multiple formulas

I have a workbook that adds a worksheet to the workbook, and then updates
formulas on that workbook to include the new worksheet. The code takes 4
seconds to run in 2003, and 168 seconds in 2007. So I ddi some testing and in
a blank worksheet I added this code:

Sub junk()

Dim inx As Integer
Dim iny As Integer

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

For inx = 0 To 299
For iny = 0 To 19

Me.Range("A1").Offset(inx, iny).Formula= "=" &
Me.Range("A1").Offset(inx, iny + 52).Address
Next
Next

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

End Sub

And tested it in Excel 2003 and 2007, IN 2003, the code barely took a
second. In 2007 it took over a minute. now I know the trick for setting
multiple cell values using arrays, but what can you do if it's the formulas
you want to update. 40x longer for code to run is just unacceptable!

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

User of MS Office 2003

 
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
Changing Multiple Formulas John Pivot Table[_2_] Excel Worksheet Functions 6 December 5th 08 09:04 PM
Changing Multiple Formulas stevieboy1313 Excel Worksheet Functions 1 August 25th 08 09:34 PM
Excel 2007 Changing Existing Formulas tm Excel Discussion (Misc queries) 1 November 20th 07 07:55 PM
Changing Multiple Cell Formulas zephyr Excel Discussion (Misc queries) 3 May 14th 07 06:35 PM
Changing Multiple Formulas japc90 Excel Discussion (Misc queries) 4 December 27th 06 08:24 PM


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