Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mtowle
 
Posts: n/a
Default Getting around Worksheet_Change()


Spreadsheet cell (s) are linked to other cells/calculations. The cells
in question will change value based on changes in values in OTHER cells
and based on calculations. I am using the following code to update
colors in final cells, but Worksheet_change() does not allow for
changes based on calcs. Any ideas as to how I can update colors?
Thanks

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

Dim cel As Range

For Each cel In Range("BB10:BF31").Cells
If IsNumeric(cel.Value) Then
If cel.Value = 1 And cel.Value <= 25 Then
cel.Interior.ColorIndex = 4
ElseIf cel.Value = 26 And cel.Value <= 50 Then
cel.Interior.ColorIndex = 35
ElseIf cel.Value = 51 And cel.Value <= 75 Then
cel.Interior.ColorIndex = 6
ElseIf cel.Value = 76 And cel.Value <= 100 Then
cel.Interior.ColorIndex = 3
End If
ElseIf cel.Value = "N/A" Then
cel.Interior.ColorIndex = 15
End If
Next


--
mtowle
------------------------------------------------------------------------
mtowle's Profile: http://www.hightechtalks.com/m114
View this thread: http://www.hightechtalks.com/t2265934

  #2   Report Post  
Harlan Grove
 
Posts: n/a
Default Getting around Worksheet_Change()

mtowle wrote...
Spreadsheet cell (s) are linked to other cells/calculations. The cells
in question will change value based on changes in values in OTHER cells
and based on calculations. I am using the following code to update
colors in final cells, but Worksheet_change() does not allow for
changes based on calcs. Any ideas as to how I can update colors?


Use the Calculate event handler. The Change event handler only runs
when you change the contents (formula) of cells. The Calculate event
handler can check specific values each time Excel recalcs.

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



All times are GMT +1. The time now is 12:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"