Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Why is the negative point on the chart Black not Red ?!!!

Morning All,

The following function is used to loop through all line charts on each
sheet of a report. I was hoping that when is finds any negative points
it would colour in that point on the chart red - it does work nu the
points are coloured black .....any help appreciated.

Regards
Jason.


'=============================================
Public Function FormatGraph(myWorksheet As String)

Sheets(myWorksheet).Select

Dim myChartObject As ChartObject
For Each myChartObject In Sheets("Daily Results").ChartObjects
myChartObject.Select

Dim myPoint As Integer, valArray

With ActiveChart.SeriesCollection(1)
valArray = .Values
For myPoint = 1 To .Points.Count
Select Case valArray(myPoint)
Case Is 0
With .Points(myPoint)
.Interior.ColorIndex = xlAutomatic
End With
Case Is = 0
With .Points(myPoint)
.Interior.ColorIndex = xlAutomatic
End With
Case Is < 0
With .Points(myPoint)
.Interior.ColorIndex = 25
.Interior.Pattern = xlSolid
End With
End Select
Next
End With

Next myChartObject
Cells(1, 1).Select

End Function 'FormatGraph
'=============================================
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Why is the negative point on the chart Black not Red ?!!!

Assuming you are using a default palette ColorIndex 25 is dark blue, which
might look like black depending on your monitor, settings, environment and
eyesight.

Maybe you want colorindex 3, or if you are not sure user might have
customized the palette
..Interior.Color = vbRed

Alternatively why not check the "Invert if negative" option and dispense
with your macro (though not red).

Regards,
Peter T



"WhytheQ" wrote in message
...
Morning All,

The following function is used to loop through all line charts on each
sheet of a report. I was hoping that when is finds any negative points
it would colour in that point on the chart red - it does work nu the
points are coloured black .....any help appreciated.

Regards
Jason.


'=============================================
Public Function FormatGraph(myWorksheet As String)

Sheets(myWorksheet).Select

Dim myChartObject As ChartObject
For Each myChartObject In Sheets("Daily Results").ChartObjects
myChartObject.Select

Dim myPoint As Integer, valArray

With ActiveChart.SeriesCollection(1)
valArray = .Values
For myPoint = 1 To .Points.Count
Select Case valArray(myPoint)
Case Is 0
With .Points(myPoint)
.Interior.ColorIndex = xlAutomatic
End With
Case Is = 0
With .Points(myPoint)
.Interior.ColorIndex = xlAutomatic
End With
Case Is < 0
With .Points(myPoint)
.Interior.ColorIndex = 25
.Interior.Pattern = xlSolid
End With
End Select
Next
End With

Next myChartObject
Cells(1, 1).Select

End Function 'FormatGraph
'=============================================



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Why is the negative point on the chart Black not Red ?!!!

On Aug 26, 10:39*am, "Peter T" <peter_t@discussions wrote:
Assuming you are using a default palette ColorIndex 25 is dark blue, which
might look like black depending on your monitor, settings, environment and
eyesight.

Maybe you want colorindex 3, or if you are not sure user might have
customized the palette
.Interior.Color = vbRed

Alternatively why not check the "Invert if negative" option and dispense
with your macro (though not red).

Regards,
Peter T

"WhytheQ" wrote in message

...



Morning All,


The following function is used to loop through all line charts on each
sheet of a report. I was hoping that when is finds any negative points
it would colour in that point on the chart red - it does work nu the
points are coloured black .....any help appreciated.


Regards
Jason.


'=============================================
Public Function FormatGraph(myWorksheet As String)


Sheets(myWorksheet).Select


Dim myChartObject As ChartObject
For Each myChartObject In Sheets("Daily Results").ChartObjects
* * * * * *myChartObject.Select


* * * * * *Dim myPoint As Integer, valArray


* * * * * *With ActiveChart.SeriesCollection(1)
* * * * * * * *valArray = .Values
* * * * * * * *For myPoint = 1 To .Points.Count
* * * * * * * * * *Select Case valArray(myPoint)
* * * * * * * * * * * *Case Is 0
* * * * * * * * * * * * * *With .Points(myPoint)
* * * * * * * * * * * * * * * *.Interior.ColorIndex = xlAutomatic
* * * * * * * * * * * * * *End With
* * * * * * * * * * * *Case Is = 0
* * * * * * * * * * * * * *With .Points(myPoint)
* * * * * * * * * * * * * * * *.Interior.ColorIndex = xlAutomatic
* * * * * * * * * * * * * *End With
* * * * * * * * * * * *Case Is < 0
* * * * * * * * * * * * * *With .Points(myPoint)
* * * * * * * * * * * * * * * * * .Interior.ColorIndex = 25
* * * * * * * * * * * * * * * * * *..Interior.Pattern = xlSolid
* * * * * * * * * * * * * *End With
* * * * * * * * * * * *End Select
* * * * * * * *Next
* * * * * *End With


Next myChartObject
Cells(1, 1).Select


End Function * * * * * *'FormatGraph
'=============================================- Hide quoted text -


- Show quoted text -




cheers Peter

atb
jason
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
aligning by decimal point - negative and positive numbers Melissa Excel Discussion (Misc queries) 4 October 4th 12 08:21 PM
Addition of error bars creates black filled in areas on chart in 2 tcek Charts and Charting in Excel 2 October 31st 08 12:27 PM
Series Lines are Not Visible in a Black Chart DOUG ECKERT[_2_] Charts and Charting in Excel 3 July 16th 08 09:28 PM
Black box when printing embedded chart to XPS PsychoMachine Charts and Charting in Excel 0 January 25th 08 07:54 PM
How do I change all chart colors to black and white? deedee3 Charts and Charting in Excel 1 March 17th 05 04:53 AM


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