Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet_Change()


Spreadsheet cell (s) are linked to other cells/calculations. The cell
in question will change value based on changes in values in OTHER cell
and based on calculations. I am using the following code to updat
colors in final cells, but Worksheet_change() does not allow fo
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
Nex

--
mtowl
-----------------------------------------------------------------------
mtowle's Profile: http://www.hightechtalks.com/m11
View this thread: http://www.hightechtalks.com/t226600

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Worksheet_Change()

If you just want it based on calculations, how about teh Worksheet_Calculate
event.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"mtowle" wrote in message
...

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/t2266009



  #3   Report Post  
Posted to microsoft.public.excel.programming
MVM MVM is offline
external usenet poster
 
Posts: 53
Default Worksheet_Change()

Use this ..

....
Application.EnableEvents = False
...
your code
....
Application.EnableEvents = True

this should take care of your problem.

MVM
"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?
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/t2266009


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_Change Jive Excel Worksheet Functions 2 June 11th 07 10:03 AM
Worksheet_change won't run Eric Excel Discussion (Misc queries) 4 March 10th 05 03:43 PM
worksheet_change aravindvin[_3_] Excel Programming 1 August 26th 04 09:10 AM
worksheet_change vs. calculate, and worksheet_change not running Tom Ogilvy Excel Programming 1 July 14th 03 02:51 AM
worksheet_change vs. calculate, and worksheet_change not running Ross[_5_] Excel Programming 0 July 13th 03 04:27 PM


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