Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , ,

Sponsored Links



Excel Function and Excel Chart Colors

Windows Software


Reply
 
Thread Tools Search this Thread
  #1  
Old 13-01-2010
Samarth's Avatar
Member
 
Join Date: Aug 2006
Posts: 124
Excel Function and Excel Chart Colors

I am given the task in Excel to complete. I have to make a chart showing 3 different pieces of information :
  1. The player's name shown horizontally
  2. The player's score shown vertically
  3. The player's exposure time to the subject, shown by the color of their bar
Is there any Excel function that is able to do this?? If anyone having idea please help me. Also I simply have to go through and hand-pick the color each individual column one by one??
__________________
Processor: AMD Athlon(tm) 64 X2 Dual Core @ ~2.2 GHz
Memory: 1024MB RAM
Hard Drive: 200 GB
Video Card: RADEON X300/X550 Series
Reply With Quote
  #2  
Old 13-01-2010
Sam.D's Avatar
Member
 
Join Date: Jan 2008
Posts: 3,735
Re: Excel Function and Excel Chart Colors

By using the VBA you can use the more conditions like you can set your own case ranges, colour values, and target range. I think that this code will work for you requirement :

Private Sub Worksheet1_Change(ByVal Target As Range)
Dim icolour As Integer
If Not Intersect(Target, Range("A1")) Is Nothing Then
Select Case Target
Case 0 To 25
icolour = 2
Case 26 To 50
icolour = 3
Case 51 To 75
icolour = 4
Case 75 To 100
icolour = 5
End Select
Target.Interior.ColorIndex = icolour
End If
End Sub
Reply With Quote
  #3  
Old 13-01-2010
ThoMas321's Avatar
Member
 
Join Date: Apr 2008
Posts: 4,078
Re: Excel Function and Excel Chart Colors

According to me even this code is useful for Excel Chart Colors :
The only thing is you'll have to set the colorindex property yourself :

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Points(1).Select
With Selection.Interior
.Pattern = xlSolid
.ColorIndex = 40
End With

ActiveChart.SeriesCollection(1).Points(2).Select
With Selection.Interior
.Pattern = xlSolid
.ColorIndex = 15
End With

ActiveChart.SeriesCollection(1).Points(3).Select
With Selection.Interior
.Pattern = xlSolid
.ColorIndex = 25
End With
__________________
Ram requirement for various OS
Reply With Quote
  #4  
Old 13-01-2010
Eric B's Avatar
Member
 
Join Date: Apr 2008
Posts: 4,645
Re: Excel Function and Excel Chart Colors

Depending on the value of it's respective "time" cell, if you are making the color every bar on the chart on your spreadsheet then you can use the following :

ActiveChart.SeriesCollection(1).Points(n).Select
With Selection.Interior
.Pattern = xlSolid
.ColorIndex = c
End With
Reply With Quote
  #5  
Old 13-01-2010
Zenon's Avatar
Member
 
Join Date: May 2008
Posts: 390
Re: Excel Function and Excel Chart Colors

You can also use this code :

ActiveChart.SeriesCollection(1).Points(3).Select
With Selection.Interior

.Pattern = xlSolid

if cells(1,1).value = 2 then
.ColorIndex = 20
elseif cells(1,1).value = 2 then
.Colorindex = 15
end if
End With

This code has been modified so that the color can be conditional.
Reply With Quote
  #6  
Old 13-01-2010
kattman's Avatar
Member
 
Join Date: Sep 2005
Posts: 1,239
Re: Excel Function and Excel Chart Colors

The code mentioned by the "Zenon" should work. Also I would like to tell that you will need to write the same code for every bar of the chart, and substitute the point numbers, colorindex and cells(r,c) for whatever's in your spreadsheet. The Cells(r,c) indicates the Row & Column containing the conditions which determine how the bars are colored. According to me you can also use the
Selection.Interior.Colorindex = c
instead of using the With --- End With blocks.
Reply With Quote
Reply

  TechArena Community > Software > Windows Software


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Excel Function and Excel Chart Colors"
Thread Thread Starter Forum Replies Last Post
How to copy colors from another workbook to new in Microsoft Excel Talisha MS Office Support 3 2 Weeks Ago 05:09 PM
How to start Excel chart at zero Hameeda-K Windows Software 2 05-01-2012 04:38 PM
Excel 2007 chart templates raviranch Windows Software 2 13-07-2009 02:30 PM
Convert a Excel chart in Image Reece Windows Software 2 09-04-2009 02:30 PM
To change Gridlines Colors in Excel Antrix Windows Software 3 27-03-2009 01:38 PM


All times are GMT +5.5. The time now is 08:53 PM.