View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
Charles Williams Charles Williams is offline
external usenet poster
 
Posts: 968
Default Worksheet_Calculate with no effect

Your code will only work when that particular worksheet is being calculated.
F9 only calculates the minimum set of sheets, cells and ranges that need
calculating, this does not neccessarily include every sheet.

Ctrl-Alt-F9 calculates everything even if it does not need to be calculated.

regards
Charles
______________________
Decision Models
FastExcel 2.3 now available
Name Manager 4.0 now available
www.DecisionModels.com

"God Itself" wrote in message
...
You,re right, but values in Ranges P6:S6 and P10:S10 are results of
formulas used. i do not change them manually

anyway, now i used Application.CalculateFull

and cells get coloured...

but.. i tested once more such a code and this Private Sub should work also
with F9 (calculate) as well as with CTRL+ALT+F9
(application.calculatefull)

regards

Użytkownik "Bill Renaud" napisał w
wiadomości . ..
Your Calculate event handler will only be called if you have cell on the
worksheet that is a formula that depends on a value in Range("P6:S6") or
Range("P10:S10"). Set a breakpoint at the first line of code and you will
see that your code never gets called when you only change the value in
one
of these cells, if you have no dependent cells.

You should be using the Change event handler, as Gary's Student
mentioned:

Private Sub Worksheet_Change(ByVal Target As Range)
'Your code here.
End Sub

--
Regards,
Bill Renaud