PC Review


Reply
Thread Tools Rate Thread

Check cell status on Calculate event: resource issues?

 
 
Seattle63
Guest
Posts: n/a
 
      11th Apr 2009
Hi. I have a resource issue question related to checking a single cell on
calculate events in a financial spreadsheet (Excel 2007). I would like to
insure that I am doing this in the most efficient way because the spreadsheet
is very calculation-intensive. It is fed via a DDE tick-by-tick stock quote
feed and thus recalculates constantly.

I need to check one single cell on calculate events (the cell contains a
formula, hence my choice of the calculate event). Please see code at bottom.

I am not concerned about the macros overhead because they won't run on
every calculate and that part is covered. However, since the cell will be
checked on each calculation event and there are so many of them, can this
create a bottleneck, or is the check of the 2 initial conditions trivial as
programmed.

Thanks in advance for advice and info.

Seattle63

Private Sub Worksheet_Calculate()
Application.EnableEvents = False
If Range("$BX$57").Value > 0 And Range("A60").Value = "Auto" Then
Worksheets("Trade").Application.Calculation = xlCalculationManual
'If 1st condition true Then execute macro1
'If 2nd condition true Then execute macro2
End If
Worksheets("Trade").Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
End Sub
 
Reply With Quote
 
 
 
 
Nigel
Guest
Posts: n/a
 
      13th Apr 2009
Cannot see how you can make it any simpler. The calculate event will run
once for each sheet recalculation regardless of the number of cells with
formulae.



--

Regards,
Nigel
(E-Mail Removed)



"Seattle63" <(E-Mail Removed)> wrote in message
news:6333CA98-DE78-4DAF-91C8-(E-Mail Removed)...
> Hi. I have a resource issue question related to checking a single cell on
> calculate events in a financial spreadsheet (Excel 2007). I would like to
> insure that I am doing this in the most efficient way because the
> spreadsheet
> is very calculation-intensive. It is fed via a DDE tick-by-tick stock
> quote
> feed and thus recalculates constantly.
>
> I need to check one single cell on calculate events (the cell contains a
> formula, hence my choice of the calculate event). Please see code at
> bottom.
>
> I am not concerned about the macros overhead because they won't run on
> every calculate and that part is covered. However, since the cell will be
> checked on each calculation event and there are so many of them, can this
> create a bottleneck, or is the check of the 2 initial conditions trivial
> as
> programmed.
>
> Thanks in advance for advice and info.
>
> Seattle63
>
> Private Sub Worksheet_Calculate()
> Application.EnableEvents = False
> If Range("$BX$57").Value > 0 And Range("A60").Value = "Auto" Then
> Worksheets("Trade").Application.Calculation = xlCalculationManual
> 'If 1st condition true Then execute macro1
> 'If 2nd condition true Then execute macro2
> End If
> Worksheets("Trade").Application.Calculation = xlCalculationAutomatic
> Application.EnableEvents = True
> End Sub


 
Reply With Quote
 
Seattle63
Guest
Posts: n/a
 
      13th Apr 2009
Hi. Thanks for your reply. I have tested it and it works. However, because of
the DDE stock feed constant updates (it's tick-by-tick) the macro runs
litterally as often as the calculate event can be fired by Excel. I am
concerned that this bogs down the spreadsheet unnecessarily and can affects
the timeliness of the DDE updates.

My first choice had been to see if I could get away with a change event but
the cells being tested and all those from which it is derived contain
formulas.

"Nigel" wrote:

> Cannot see how you can make it any simpler. The calculate event will run
> once for each sheet recalculation regardless of the number of cells with
> formulae.
>
>
>
> --
>
> Regards,
> Nigel
> (E-Mail Removed)
>
>
>
> "Seattle63" <(E-Mail Removed)> wrote in message
> news:6333CA98-DE78-4DAF-91C8-(E-Mail Removed)...
> > Hi. I have a resource issue question related to checking a single cell on
> > calculate events in a financial spreadsheet (Excel 2007). I would like to
> > insure that I am doing this in the most efficient way because the
> > spreadsheet
> > is very calculation-intensive. It is fed via a DDE tick-by-tick stock
> > quote
> > feed and thus recalculates constantly.
> >
> > I need to check one single cell on calculate events (the cell contains a
> > formula, hence my choice of the calculate event). Please see code at
> > bottom.
> >
> > I am not concerned about the macros overhead because they won't run on
> > every calculate and that part is covered. However, since the cell will be
> > checked on each calculation event and there are so many of them, can this
> > create a bottleneck, or is the check of the 2 initial conditions trivial
> > as
> > programmed.
> >
> > Thanks in advance for advice and info.
> >
> > Seattle63
> >
> > Private Sub Worksheet_Calculate()
> > Application.EnableEvents = False
> > If Range("$BX$57").Value > 0 And Range("A60").Value = "Auto" Then
> > Worksheets("Trade").Application.Calculation = xlCalculationManual
> > 'If 1st condition true Then execute macro1
> > 'If 2nd condition true Then execute macro2
> > End If
> > Worksheets("Trade").Application.Calculation = xlCalculationAutomatic
> > Application.EnableEvents = True
> > End Sub

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get true status of check box in datagridview cell Parrot Microsoft C# .NET 0 6th Aug 2008 08:43 PM
How to check the status of the UDP port status tsgd84 Windows Networking 0 2nd Jul 2008 02:35 PM
Cell wrapping event, does it exist? How can I calculate cell filli =?Utf-8?B?TWlrZQ==?= Microsoft Excel Programming 3 10th Nov 2006 01:19 AM
how do I create event-activated macros that check every cell? JLC Microsoft Excel Programming 4 29th Nov 2005 05:08 PM
Failed to load resource from resource file. Plese check up your setup Andry Microsoft Dot NET Framework 0 22nd Nov 2005 07:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:47 PM.