Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Worksheet_Calculate with no effect

What is the calculation mode in ToolsOptionsCalculation?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"God Itself" wrote in message
...
it does not change when F9 or caluculate is used (automatic caluclation is
disabled)

i dunno why..

Użytkownik "Bob Phillips" napisał w wiadomości
...
It works for me.

You do realise it is using the worksheet_Calculate event, so it doesn't
change when you change those values.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"God Itself" wrote in message
...
Hi,

i have such a code:

Private Sub Worksheet_Calculate()
Dim rang As Range
Application.ScreenUpdating = False
Application.EnableEvents = False
For Each rang In Range("P6:S6")

If rang.Value = "-" Then
rang.Interior.ColorIndex = 2
rang.Font.ColorIndex = 2
ElseIf rang = -1 And rang < -0.8 Then
rang.Interior.ColorIndex = 11
ElseIf rang = -0.8 And rang < -0.6 Then
rang.Interior.ColorIndex = 5
ElseIf rang = -0.6 And rang < -0.4 Then
rang.Interior.ColorIndex = 41
ElseIf rang = -0.4 And rang < -0.2 Then
rang.Interior.ColorIndex = 33
ElseIf rang = -0.2 And rang < 0 Then
rang.Interior.ColorIndex = 34
ElseIf rang = 0 And rang < 0.2 Then
rang.Interior.ColorIndex = 40
ElseIf rang = 0.2 And rang < 0.4 Then
rang.Interior.ColorIndex = 44
ElseIf rang = 0.4 And rang < 0.6 Then
rang.Interior.ColorIndex = 45
ElseIf rang = 0.6 And rang < 0.8 Then
rang.Interior.ColorIndex = 46
ElseIf rang = 0.8 And rang < 1 Then
rang.Interior.ColorIndex = 53
End If

If rang = -1 And rang < -0.6 Then
rang.Font.ColorIndex = 2
ElseIf rang = -0.6 And rang < 0.6 Then
rang.Font.ColorIndex = 1
ElseIf rang = 0.6 And rang < 1 Then
rang.Font.ColorIndex = 2
End If

Next

For Each rang In Range("P10:S10")

If rang.Value = "-" Then
rang.Interior.ColorIndex = 2
rang.Font.ColorIndex = 2
ElseIf rang = -1 And rang < -0.8 Then
rang.Interior.ColorIndex = 11
ElseIf rang = -0.8 And rang < -0.6 Then
rang.Interior.ColorIndex = 5
ElseIf rang = -0.6 And rang < -0.4 Then
rang.Interior.ColorIndex = 41
ElseIf rang = -0.4 And rang < -0.2 Then
rang.Interior.ColorIndex = 33
ElseIf rang = -0.2 And rang < 0 Then
rang.Interior.ColorIndex = 34
ElseIf rang = 0 And rang < 0.2 Then
rang.Interior.ColorIndex = 40
ElseIf rang = 0.2 And rang < 0.4 Then
rang.Interior.ColorIndex = 44
ElseIf rang = 0.4 And rang < 0.6 Then
rang.Interior.ColorIndex = 45
ElseIf rang = 0.6 And rang < 0.8 Then
rang.Interior.ColorIndex = 46
ElseIf rang = 0.8 And rang < 1 Then
rang.Interior.ColorIndex = 53
End If

If rang = -1 And rang < -0.6 Then
rang.Font.ColorIndex = 2
ElseIf rang = -0.6 And rang < 0.6 Then
rang.Font.ColorIndex = 1
ElseIf rang = 0.6 And rang < 1 Then
rang.Font.ColorIndex = 2
End If

Next

Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub

unfortunatelly, cells in ranges P6:S6 and P10:S10 are not being coloured
and i have no idea why

how can i check this






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Worksheet_Calculate with no effect

manual

Użytkownik "Bob Phillips" napisał w wiadomości
...
What is the calculation mode in ToolsOptionsCalculation?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Worksheet_Calculate with no effect

The excel won't recalc until you force it to. And if excel isn't recalculating,
then the _calculation event won't fire.

God Itself wrote:

manual

Użytkownik "Bob Phillips" napisał w wiadomości
...
What is the calculation mode in ToolsOptionsCalculation?


--

Dave Peterson
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
Worksheet_Calculate tmkkoservo Excel Programming 1 August 20th 07 04:08 PM
worksheet_calculate enyaw Excel Discussion (Misc queries) 2 January 26th 07 01:16 PM
worksheet_calculate enyaw Excel Discussion (Misc queries) 0 January 26th 07 08:14 AM
Worksheet_calculate() Alex Excel Programming 1 August 30th 05 10:09 PM
worksheet_calculate **help** tommyboy Excel Programming 2 June 29th 04 08:33 AM


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