LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Would this require a program in EXCEL? multiple conditional statements

Here is some code:
If your values keep changing, you could turn that into an event procedure.

HTH
--
AP

'-------------
Option Explicit

Sub test()
Call SetColors(Range("A1:AF32"))
End Sub


Sub SetColors(rArray As Range)

Const dDelta As Double = 0.25
Dim rCell As Range

For Each rCell In rArray
With rCell
Select Case .Value
Case 4 - dDelta To 4 + dDelta: .Interior.ColorIndex = 33
Case 5 - dDelta To 5 + dDelta: .Interior.ColorIndex = 34
Case 6 - dDelta To 6 + dDelta: .Interior.ColorIndex = 35
Case 7 - dDelta To 7 + dDelta: .Interior.ColorIndex = 36
Case 8 - dDelta To 8 + dDelta: .Interior.ColorIndex = 37
Case 9 - dDelta To 9 + dDelta: .Interior.ColorIndex = 38
Case 10 - dDelta To 10 + dDelta: .Interior.ColorIndex = 39
Case 11 - dDelta To 11 + dDelta: .Interior.ColorIndex = 40
Case 12 - dDelta To 12 + dDelta: .Interior.ColorIndex = 41
Case 13 - dDelta To 13 + dDelta: .Interior.ColorIndex = 42
Case 14 - dDelta To 14 + dDelta: .Interior.ColorIndex = 43
Case Else: .Interior.ColorIndex = xlColorIndexNone
End Select
End With
Next rCell
End Sub
'--------------
"John David" a
écrit dans le message de news:
...

Where would I start if I needed to code this? I have no prior
experience.

John


--
John David
------------------------------------------------------------------------
John David's Profile:
http://www.excelforum.com/member.php...o&userid=34609
View this thread: http://www.excelforum.com/showthread...hreadid=543830





 
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
If Statements??/Conditional formatting from drop-down multiple she sarah Excel Worksheet Functions 1 June 25th 09 05:51 AM
Multiple CheckBoxes can be selected require additional info if sel Goldenfoot Excel Worksheet Functions 1 April 3rd 07 01:46 PM
Conditional formatting combined with multiple IF statements Hendrik Excel Worksheet Functions 7 March 22nd 07 06:03 PM
Require a lookup to return multiple values Matt Excel Programming 1 February 14th 05 06:47 PM
How do I set up multiple if statements in Excel? LKraft0318 Excel Worksheet Functions 2 February 9th 05 09:53 PM


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