Lite'n up the Macro - cell auto change counter

Jer-XL-emy

Board Regular
Joined
Aug 27, 2007
Messages
60
Hello, back to the genius board...and back for me asking directions (I hate asking for directions when I am lost - like most men, but here I get some social intellectual value when I find myself lost

Here is my problem - I am trying to get a counter to count +1 every time a cell changes (easy enough since I have recieved many that help me out with that), but the brain buster is that I need it to count everytime a cell changes by a DDE feed (the previous only worked manually). So for that I am told it must be a _calculate event (vs a _change event).

Now Boller (long time poster and I beleive genius) made me a little (well actually big) thinger that worked. It reads


Code:

Private Sub Worksheet_Calculate()
Dim rng As Range, cell As Range
Application.EnableEvents = False
[Z:AA].ClearContents
Range([Z1], [V65536].End(xlUp)(1, 6)).FormulaR1C1 = "=IF(RC[-4]=RC[-2],"""",1)"
On Error Resume Next
Set rng = [Z:AA].SpecialCells(xlCellTypeFormulas, 1)
On Error GoTo 0
If Not rng Is Nothing Then
For Each cell In rng
cell(1, -8) = cell(1, -8) + 1
Next
End If
[X:Y] = [V:W].Value
Range([Z1], [V65536].End(xlUp)(1, 6)).FormulaR1C1 = "=IF(RC[-4]=RC[-2],"""",1)"
Application.EnableEvents = True
End Sub




Thats after a little set up Macro.

The problem is that it has a latency issue as it calculates down the column and then Xl freezes (has a hourglass) for about 4 seconds on a single calculation and I can here my processor fan crank (I have a newer machine and 2007 excel - that is suppose to use my dualcore quite efficently - so I am told). In the real world of the application, there could be multiple calcs (like 25) going on at the same time - thus the problem.

So I call on you all to maybe see what is needed (if its possible) to fix the latency stall of my worksheet as there are other independent cells that are in calculation mode as well (though when testing 'er I used one calculation)?

What is the problem likely caused by - the error work around or the large column as a range or...?

I have no problem with have another worksheet or wbook calculate this and have it linked (or =(reference cell)) to the wsheet I want visible as too leave the other independant cells alone doing their job - if necessary

Nor do I have a problem using a tighter range - for reference it is
counter cells Q 6-242 and R 6-242 cells that need counting (DDE feed) V 6-242 and W 6-242

For those who are studius the previous post is http://www.mrexcel.com/board2/viewtopic.php?p=1396040#1396040

So this has been a weeklong adventure and while it hasbeen fun, fun has changed to frustration - lol,

I call to you all to fix me up, until the next next week I get stuck (big project probably never ending now that I realize the power of coding in Excel - - and I apprciate your guys' help
Thanks in advance

Jeremy
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top