»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 07-08-2003, 12:55 PM   #1 (permalink)
Registered User
 
Join Date: Jul 2003
Posts: 2
rothss is on a distinguished road

I am trying to display output on a graph in different colors depending on the numerical value. (i.e. red if the value is less than 90, yellow if the value is between 90 and 95, or green if the value is greater than 95.) I have created my macros (named them green, red and yellow) but can't figure out how to get them into an IF statement. Any ideas would be greatly appreciated. Thanks.

rothss is offline   Reply With Quote
Old 07-10-2003, 10:53 AM   #2 (permalink)
Registered User
 
Join Date: Oct 2001
Location: Bridgewater, NJ
Posts: 924
JimG is on a distinguished road
Send a message via AIM to JimG
Can you post the code for your macros?? I'm sure we can help you out with this. I'm assuming this is in Excel ... so here's my first thought as to how do this in VBA:

For each c in Range()

If {cell value} < 90 Then
{Graph Point 1} = Red
Else if {cell value} =< 95 Then
{Graph Point 1} = Yellow
Else if {cell value} < 95 Then
{Graph Point 1} = Green
Else
{Graph Point 1}=Black
End if

Next c

*Now, bear in mind I wrote that without verifying it or anything else. It will not run as written; this is just to give you an idea of the basic structure.
JimG is offline   Reply With Quote
Old 07-10-2003, 12:09 PM   #3 (permalink)
Registered User
 
Join Date: Jul 2003
Posts: 2
rothss is on a distinguished road
Here is my code for my macro. (I also have one for yellow and green.) For some reason I can't put my macro in my IF function.....do those funny brackets do the trick? I'll give your code a shot and see what I get. Thank you very much.

Sub Red()
'
' Red Macro
' Macro recorded 7/10/2003 by PV Employee
'

'
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
End Sub
rothss is offline   Reply With Quote
Old 07-10-2003, 06:05 PM   #4 (permalink)
Registered User
 
Join Date: Oct 2001
Location: Bridgewater, NJ
Posts: 924
JimG is on a distinguished road
Send a message via AIM to JimG
No, those funny brackets will not do the trick ... I put them there to show the pieces of the code that are not right (i.e. saying "cell value" will not give you the value of the cell) ...
I'm gonna pump your macro into excel and see what I get
JimG is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 03:27 AM.