Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
Ray Ray is offline
external usenet poster
 
Posts: 267
Default Ferrero's Conditional Bar Chart Qs

hello -

I've discovered Ed Ferrero's Conditional Bar Chart code and downloaded
the sample workbook, as I think it could be very useful in my work.
You can find it he
http://www.edferrero.com/ExcelCharts...2/Default.aspx

However, I need to make some modifications and am having a very hard
time following the coding .... so, I can't make the necessary
modifications! In theory, it should be fairly easy ... my situation
is this:
** User makes a selection in cell A7 (via Validation)
** this value if fed (via direct link) to A97 ... B97:AN97 contain an
HLOOKUP based on A97
** B97:AN97 are conditionally formatted (interior.colorindex=red) if
cell value is a permanent number
** A97:AN97 is used as the source_range for my bar chart

So, all I want to do is make the chart bars the same color as the cell
color in range B97:AN97...

Can anyone help to make these changes?

thanks, ray

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 235
Default Ferrero's Conditional Bar Chart Qs

You could use a Worksheet_Change event with the following code and probably
achieve the same goal (I'm guessing).

To do so, copy this code into the sheet module in which you chart resides
(I'm assuming an embedded chart).

Name the chart something that you can specify in the code below. In this
example I've named the chart "Cht1".

The procedure will fire any time the worksheet is changed.

Private Sub Worksheet_Change(ByVal Target As Range)

Dim Cht As ChartObject
Dim Color As Integer

Set Cht = ActiveSheet.ChartObjects("Cht1")

Cnt = 1

'This is the range that includes the colored cells
For Each Rng In Range("$B$97:$AN$97")
Color = Rng.Interior.ColorIndex
Set Pts = Cht.Chart.SeriesCollection(1).Points(Cnt)
Pts.Interior.ColorIndex = Color
Cnt = Cnt + 1
Next Rng

End Sub

Hope this might help.

--
John Mansfield
http://cellmatrix.net





"Ray" wrote:

hello -

I've discovered Ed Ferrero's Conditional Bar Chart code and downloaded
the sample workbook, as I think it could be very useful in my work.
You can find it he
http://www.edferrero.com/ExcelCharts...2/Default.aspx

However, I need to make some modifications and am having a very hard
time following the coding .... so, I can't make the necessary
modifications! In theory, it should be fairly easy ... my situation
is this:
** User makes a selection in cell A7 (via Validation)
** this value if fed (via direct link) to A97 ... B97:AN97 contain an
HLOOKUP based on A97
** B97:AN97 are conditionally formatted (interior.colorindex=red) if
cell value is a permanent number
** A97:AN97 is used as the source_range for my bar chart

So, all I want to do is make the chart bars the same color as the cell
color in range B97:AN97...

Can anyone help to make these changes?

thanks, ray


  #3   Report Post  
Posted to microsoft.public.excel.charting
Ray Ray is offline
external usenet poster
 
Posts: 267
Default Ferrero's Conditional Bar Chart Qs

Thanks John! A tweak here and there ... and it works perfectly!




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
Conditional Chart excelBRISKbaby Excel Discussion (Misc queries) 1 June 6th 07 08:03 PM
Conditional chart series. DaveO Charts and Charting in Excel 1 February 15th 07 06:31 PM
Conditional chart Graeme Bowser Charts and Charting in Excel 1 October 11th 05 09:39 AM
Conditional formatting a bar chart Caro-Kann Defence Charts and Charting in Excel 2 September 13th 05 01:52 PM
Conditional formatting in a chart Baro Charts and Charting in Excel 3 June 27th 05 06:01 AM


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