#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default A sorted chart?

Hi all -

I'm new to VBA in Excel. I have a chart on a Worksheet. And in my VBA
code I tell it where to grab data from:

Worksheets("REPORT").ChartObjects(1).Chart.SetSour ceData
Source:=Sheets("Sheet1").Range(Sheets("Sheet1").Ce lls(ListBox1.ListIndex
+ 2, 2), Sheets("Sheet1").Cells(ListBox1.ListIndex + 2, numofCols + 1)),
PlotBy:=xlRows


Yikes. That's one long statement. It grabs a row from "Sheet1" to fill
the chart on sheet "REPORT". It works. But I need the data to be
sorted so that the graph looks good (i.e. I want the biggest bars to be
on the left and then taper down). Is there a way to instruct the chart
to sort the data? Or maybe there's a way to tell SetSourceData to sort
it?

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default A sorted chart?

You have to sort the data in the sheet.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Brad Stone" wrote in message
...
Hi all -

I'm new to VBA in Excel. I have a chart on a Worksheet. And in my VBA
code I tell it where to grab data from:

Worksheets("REPORT").ChartObjects(1).Chart.SetSour ceData
Source:=Sheets("Sheet1").Range(Sheets("Sheet1").Ce lls(ListBox1.ListIndex
+ 2, 2), Sheets("Sheet1").Cells(ListBox1.ListIndex + 2, numofCols + 1)),
PlotBy:=xlRows


Yikes. That's one long statement. It grabs a row from "Sheet1" to fill
the chart on sheet "REPORT". It works. But I need the data to be
sorted so that the graph looks good (i.e. I want the biggest bars to be
on the left and then taper down). Is there a way to instruct the chart
to sort the data? Or maybe there's a way to tell SetSourceData to sort
it?

Thanks!



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
Sorted Columns JC Excel Discussion (Misc queries) 2 August 25th 06 10:05 PM
Chart Series Formats lost when list re -sorted Fullam Excel Discussion (Misc queries) 1 June 6th 06 10:44 AM
Sorted list G Chartrand Excel Discussion (Misc queries) 2 April 28th 06 05:07 PM
Sorted Tinus Excel Discussion (Misc queries) 2 October 15th 05 09:53 PM
sorted ceemo Excel Worksheet Functions 1 July 5th 05 05:36 PM


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