#1   Report Post  
anantathaker
 
Posts: n/a
Default bar graph question


Hello everyone,

I have data with 5 variables for 10 countries, and I have made a
horizontal bar graph for each variable (so 5 graphs). This data is
linked to another page, and it is divided by variable within the sheet.
For example, the format is:

Country Variable 1
US ###
China ###
India ###
UK ###

Country Variable 2
US ###
China ###
India ###
UK ###

There is a macro that sorts each of this mini-tables, and then each
graph draws from its respective variable table. The same 10 countries
are in each table, but they are not in the same order, because they are
sorted from largest to smallest so that each horizontal bar graph is
sorted largest to smallest.

My question is, how can I make it so that each country has the same
color bar in each of the 5 graphs? For example, the US has a red bar in
each graph, regardless of its position. Is there a way to do this? I'm
no VBA expert, but is there some sort of conditional macro I can do
(any code someone has would be extremely helpful)? Is there an easier
way? Thanks!!


--
anantathaker
------------------------------------------------------------------------
anantathaker's Profile: http://www.excelforum.com/member.php...o&userid=18133
View this thread: http://www.excelforum.com/showthread...hreadid=380066

  #2   Report Post  
bj
 
Posts: n/a
Default

one way to do it is to use a stacked bar with a different data set for each
country with Zeros for the other countries and the value for the specific
country of interest
when you set up the graph just set the color of the bar for each catagory as
wanted.

"anantathaker" wrote:


Hello everyone,

I have data with 5 variables for 10 countries, and I have made a
horizontal bar graph for each variable (so 5 graphs). This data is
linked to another page, and it is divided by variable within the sheet.
For example, the format is:

Country Variable 1
US ###
China ###
India ###
UK ###

Country Variable 2
US ###
China ###
India ###
UK ###

There is a macro that sorts each of this mini-tables, and then each
graph draws from its respective variable table. The same 10 countries
are in each table, but they are not in the same order, because they are
sorted from largest to smallest so that each horizontal bar graph is
sorted largest to smallest.

My question is, how can I make it so that each country has the same
color bar in each of the 5 graphs? For example, the US has a red bar in
each graph, regardless of its position. Is there a way to do this? I'm
no VBA expert, but is there some sort of conditional macro I can do
(any code someone has would be extremely helpful)? Is there an easier
way? Thanks!!


--
anantathaker
------------------------------------------------------------------------
anantathaker's Profile: http://www.excelforum.com/member.php...o&userid=18133
View this thread: http://www.excelforum.com/showthread...hreadid=380066


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
How do I create a combination graph with stackedColumns+lineGraph ChartQuestion Charts and Charting in Excel 1 June 14th 05 12:39 PM
Graph from a PIVOT table: update not working. Please Help! Marcus Excel Discussion (Misc queries) 0 June 7th 05 05:53 PM
Graph Help- 12 month graph, but only want months that have passed coal_miner Charts and Charting in Excel 4 June 3rd 05 03:03 PM
Line Graph Data Recognition Nat Charts and Charting in Excel 2 April 30th 05 02:07 PM
Graph Axes Robin Excel Discussion (Misc queries) 0 December 8th 04 08:03 PM


All times are GMT +1. The time now is 01:14 AM.

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"