Poor calculation speed affects productivity and increases user errors. Studies have shown that a user's productivity and ability to focus on a task deteriorate as response time lengthens.
Excel has two main calculation modes, which let you control when calculation occurs: * Automatic calculation Formulas are automatically recalculated whenever you make a change. * Manual calculation Formulas are only recalculated when you request it (for example, by pressing F9). '''**************************************************************************************************************************************************************** If you write the code for VBA & it run slow.There are many cases 1.processor 2.ram 3.loop in code '''**************************************************************************************************************************************************************** So if it is not possible to upgrade your pc,Then try to switch on manual calculation. You have to first ensure that there is no any bug,error. '''**************************************************************************************************************************************************************** Sub GoToManual() Dim xlCalc As XlCalculation xlCalc = Application.Calculation Application.Calculation = xlCalculationManual On Error GoTo CalcBack 'YOUR CODE Application.Calculation = xlCalc Exit Sub CalcBack: Application.Calculation = xlCalc End Sub '''**************************************************************************************************************************************************************** Hope it will Help Happy to Help :) Shyam On Tue, Mar 23, 2010 at 2:56 AM, scubagirl <jill.brya...@gmail.com> wrote: > Thanks for your suggestions/help. I checked to make sure that all of > the loops use "Exit For" when appropriate. I am using Excel 2007 which > *could* be causing some of the slowdown, but Excel only really comes > in at the end for result output, it could explain why my speed tests > are so slow (I've been outputting the time for some functions to > complete to Excel). The following function seems to be taking up a > good chunk of the time: > > 'create a list of tasks that are eligible to run > Private Function GetEligibleTasks() As Collection > > Dim eligible_tasks As New Collection > Dim t As cTask > > For Each t In tasklist > > 'make sure the task hasn't been started yet > If t.Status = 0 Then > > t.StartDate = tracker.CurrentDate > > 'make sure it can be started > If t.ReadyToStart() Then > > eligible_tasks.Add t > > eligible_tasks.item(eligible_tasks.count).EligibleTaskIndex = > eligible_tasks.count > > End If > End If > > Next t > > Set GetEligibleTasks = eligible_tasks > End Function > > 'determine if a task is ready to start by checking > 'whether its predecessors have completed > Public Function ReadyToStart() As Boolean > > Dim pred As Tasks > Dim j As Integer > Dim start As Date > Dim p As task > > Set pred = ActiveProject.Tasks(Index).PredecessorTasks 'get a list > of the preceeding tasks > > 'if the task has no predecessors, it's ready to run > If pred.count = 0 Then > ReadyToStart = True > Exit Function > End If > > For Each p In pred > > Dim test As Date > test = p.Finish > > 'if a predecessor hasn't been completed, this task isn't ready > to run > If tasklist.item(p.ID).Status <> 2 Then > ReadyToStart = False > Exit Function > > Else > ReadyToStart = True > End If > Next > > End Function > > > In this case tasklist is a Collection. To me, it doesn't look like > this could get much more efficient - any suggestions? (I can't post > the whole project because it's company protected information) > > -- > ---------------------------------------------------------------------------------- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our Facebook Group @ > http://www.facebook.com/group.php?gid=287779555678 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > HELP US GROW !! > > We reach over 6,800 subscribers worldwide and receive many nice notes about > the learning and support from the group.Let friends and co-workers know they > can subscribe to group at > http://groups.google.com/group/excel-macros/subscribe > > To unsubscribe from this group, send email to > excel-macros+unsubscribegooglegroups.com or reply to this email with the > words "REMOVE ME" as the subject. > -- Thanks Regards Shyam Software Engineer '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us. - Helen Keller '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Wenn eine Tür des Glücks schließt, öffnet sich ein weiteres, aber oft schauen wir so lange auf die geschlossene Tür, dass wir nicht sehen ein, die für uns geöffnet wurde. - Helen Keller '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our Facebook Group @ http://www.facebook.com/group.php?gid=287779555678 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,800 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe To unsubscribe from this group, send email to excel-macros+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.