Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mikey9131
 
Posts: n/a
Default Using data from coloured cells in a chart

I'd like to be able to use data that is entered onto worksheet to produce a
number of charts, but only want each chart to use data from cells that are
formatted in a certain fill colour. On other words, one chart might use data
from cells coloured red, another chart from cells coloured green etc. is this
possible and how would I go about doing it?

Any help gratefully appreciated
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben
 
Posts: n/a
Default Using data from coloured cells in a chart

Mikey

Assuming the cells are colored manually and not by Conditional Formatting you
could first find the color index numbers of the cells then AutoFilter on those
numbers.

Say you have data in A1:A200.

Creat a chart based on that range.

In Column B enter the formula =CellColorIndex(cellref)

Double-click on the fill handle to copy down to end of data in Column A.

The CellColorIndex Function is a User Defined Function from Chip Pearson.

Function CellColorIndex(inRange As Range, Optional _
OfText As Boolean = False) As Integer
' This function returns the ColorIndex value of a the Interior
' (background) of a cell, or, if OfText is true, of the Font in the cell.
Application.Volatile True
If OfText = True Then
CellColorIndex = inRange.Font.ColorIndex
Else
CellColorIndex = inRange.Interior.ColorIndex
End If
End Function

The UDF would be copied and placed into a General Module in your workbook.

Filter on the numbers you get in the column.

Your chart will change to reflect the filtered data.

If you want a chart for each set of filtered data, create one for each.


Gord Dibben Excel MVP

On Sat, 26 Nov 2005 11:17:06 -0800, Mikey9131
wrote:

I'd like to be able to use data that is entered onto worksheet to produce a
number of charts, but only want each chart to use data from cells that are
formatted in a certain fill colour. On other words, one chart might use data
from cells coloured red, another chart from cells coloured green etc. is this
possible and how would I go about doing it?

Any help gratefully appreciated


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
Combination chart with three data ranges Joe Mac Charts and Charting in Excel 2 July 11th 05 11:00 PM
Fan charts Dean Charts and Charting in Excel 7 May 30th 05 11:51 AM
Help making a chart that doesn't graph cells without data? Filtration Guy Excel Discussion (Misc queries) 0 March 22nd 05 10:21 PM
Help with data not getting plotted Scott Ehrlich Excel Discussion (Misc queries) 2 January 25th 05 06:17 AM
Extending a Chart Data Series from an Array - Can it be done? Jon Peltier Charts and Charting in Excel 4 November 30th 04 04:30 AM


All times are GMT +1. The time now is 09:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"