LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Modify sub to work on cells with formulas

The sheet sub below works with values (1,2) input into the range IM2:IM100,
but fails if IM2:IM100 contains formulas returning the values 1,2. How can
it be modified to work with formulas? Thanks

Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer, fcolor As Integer
If Not Intersect(Target, Range("IM2:IM100")) Is Nothing Then
Select Case Target
Case 1
icolor = 6
fcolor = 6
Case 2
icolor = 12
fcolor = 12
End Select

With Target
.Interior.ColorIndex = icolor
.Font.ColorIndex = fcolor
End With
End If
End Sub
 
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
Can Data Validation work on cells with formulas? Ruben Excel Discussion (Misc queries) 1 July 26th 07 06:34 PM
Why do my formulas work in some cells but not others? Lowly Worm Excel Worksheet Functions 3 September 30th 05 05:38 PM
Correct formulas in cells, have to retype to work budsb1 Excel Discussion (Misc queries) 3 March 5th 05 11:45 AM
Modify SUMIF and COUNTIF to work with SUBTOTALS SSHO_99 Excel Worksheet Functions 2 November 12th 04 11:36 PM
modify formulas with dropdown James[_14_] Excel Programming 1 November 17th 03 04:56 PM


All times are GMT +1. The time now is 03:09 PM.

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"