#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default calc

Hi all,

I have a spreadsheet with about 20 columns of data, 3 of which are
long-winded array formulas. I have some conditional formats and simple IF
functions in the other 17 columns. I would like to keep the sheet calc to
auto, but this makes entry slow because of the 3 columns of arrays. Is there
a way to exclude the array columns so I can keep the auto calc?

Thanks in advance,

SPL


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default calc

VBA can calculate just a single range. Something like:

Sub CalcRange
Sheets("Data").Range("E:F").Calculate
End Sub

You can have calculation option to Manual and use a button to call this
procedure.

HTH
Kostis Vezerides

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default calc

Thank you
"vezerid" wrote in message
oups.com...
VBA can calculate just a single range. Something like:

Sub CalcRange
Sheets("Data").Range("E:F").Calculate
End Sub

You can have calculation option to Manual and use a button to call this
procedure.

HTH
Kostis Vezerides



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default calc

Is there a way I could get excel to run this code automatically, say every
minute?
"vezerid" wrote in message
oups.com...
VBA can calculate just a single range. Something like:

Sub CalcRange
Sheets("Data").Range("E:F").Calculate
End Sub

You can have calculation option to Manual and use a button to call this
procedure.

HTH
Kostis Vezerides



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default calc

Yes, you can use the Application.OnTime method. I am providing the full
set of subs that you need. You will need a global variable to remember
the next time a calculation is scheduled, so that you can stop periodic
calculation:

Public NextSchedule As Date

Sub CalcRange()
Sheets("Data").Range("E:F").Calculate
End Sub

Sub StartPeriodicCalculation()
Call CalcRange
NextSchedule = Now + TimeValue("00:01:00")
Application.OnTime NextSchedule, "StartPeriodicCalculation"
End Sub

Sub StopPeriodicCalculation()
Application.OnTime NextSchedule, "StartPeriodicCalculation", , False
End Sub

You call Start once. It will take care of subsequent schedules. Then
you call Stop when you are done. In fact, it might be a better idea if
you place the body of Stop in Workbook_BeforeClose, so that it is
guaranteed to work even if you forget to call Stop explicitly.

Beware, I have used OnTime in the past, even though I tried ways of
ensuring that the scheduling stops, sometimes the cancellation did not
work. The result was that Excel was restarting to execute the scheduled
subs.

HTH
Kostis Vezerides



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default calc

Thank you very much, that is fantastic.
"vezerid" wrote in message
ps.com...
Yes, you can use the Application.OnTime method. I am providing the full
set of subs that you need. You will need a global variable to remember
the next time a calculation is scheduled, so that you can stop periodic
calculation:

Public NextSchedule As Date

Sub CalcRange()
Sheets("Data").Range("E:F").Calculate
End Sub

Sub StartPeriodicCalculation()
Call CalcRange
NextSchedule = Now + TimeValue("00:01:00")
Application.OnTime NextSchedule, "StartPeriodicCalculation"
End Sub

Sub StopPeriodicCalculation()
Application.OnTime NextSchedule, "StartPeriodicCalculation", , False
End Sub

You call Start once. It will take care of subsequent schedules. Then
you call Stop when you are done. In fact, it might be a better idea if
you place the body of Stop in Workbook_BeforeClose, so that it is
guaranteed to work even if you forget to call Stop explicitly.

Beware, I have used OnTime in the past, even though I tried ways of
ensuring that the scheduling stops, sometimes the cancellation did not
work. The result was that Excel was restarting to execute the scheduled
subs.

HTH
Kostis Vezerides



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default calc

Thanks for the feedback. Glad to be of help.

Kostis

Reply
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
My calc key on Excel changes box to "Text" Box and doesn't calc ? jack Charts and Charting in Excel 0 August 8th 06 07:30 PM
Open CSV causes calculation in manual calc mode [email protected] Excel Discussion (Misc queries) 0 July 25th 06 09:22 PM
Pivot Tbl Calc Field using %'s gramos14 Excel Discussion (Misc queries) 4 April 3rd 06 03:25 AM
Calc RSQ and exclude zeros Bruce Excel Worksheet Functions 3 January 19th 06 01:01 PM
NPV calc with more than 29 arguements? Felix Excel Worksheet Functions 3 April 13th 05 11:25 PM


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