chart - in order of high to low

T

tracktraining

Hi All,

I would like to create bar graph using vba. I know how to do a simple bar
graph, but need help with a bit more complex one (well complex for me).

I have the following data in my excel sheet:

A B
1 Fish 0
2 Dog 2
3 Cat 4
4 Rat 0
5 Bat 5


I would like to have a bar graph with the first bar to be Bat (5), Cat(4),
Dog (2), Fish(0), and Rat (0)............ But the bar graph will change if
the value of B changes. So the bar graph should look for the largest value
and have that to be the first bar and then the second largest value to be the
second bar and so on.

Please help. Thanks

Tracktraining
 
R

ryguy7272

Ok, just got to Data > Sort, then Sort by the 2nd Column, and then sort by
the 1st Column (to make Fish listed before Rat). Then, just build your
graph.


Regards,
Ryan---
 
T

tracktraining

Thanks! that is perfect!
--
Learning


ryguy7272 said:
Ok, just got to Data > Sort, then Sort by the 2nd Column, and then sort by
the 1st Column (to make Fish listed before Rat). Then, just build your
graph.


Regards,
Ryan---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top