Advertisement

07.04.2008 at 11:37AM PDT, ID: 23539869
[x]
Attachment Details

Select Case between two values

Asked by jppinto in Microsoft Excel Spreadsheet Software

Tags:

Hello,

I've the following code. My problem is with line:

Case Is >= dblTarget, Is <= (dblTarget * 1.05)

I want to make a Case between dblTarget and (dblTarget*1.05). The way I've the code, it's assuming the "," as an OR, right, instead of an AND, right?

Thanks for the help,

jppintoStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
Select Case dblActual
   Case Is < dblTarget
      Shp.Fill.ForeColor.RGB = vbGreen
   Case Is >= dblTarget, Is <= (dblTarget * 1.05)
      Shp.Fill.ForeColor.RGB = vbYellow
   Case Is > (dblTarget * 1.05)
      Shp.Fill.ForeColor.RGB = vbRed
   Case Else
      Shp.Fill.ForeColor.RGB = 0
End Select
[+][-]07.04.2008 at 11:41AM PDT, ID: 21934362

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Excel Spreadsheet Software
Tags: Select Case between
Sign Up Now!
Solution Provided By: zorvek
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.04.2008 at 11:44AM PDT, ID: 21934369

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.04.2008 at 11:45AM PDT, ID: 21934372

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906