#1   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Mark,

Try the macro below. Assumes you are only charting one line, in a line
chart.

HTH,
Bernie
MS Excel MVP

Sub MarksMacro()
Dim mySht As Worksheet
Dim iStrStart As Integer
Dim iStrEnd As Integer
Dim myRef As String
Dim myAdd As String

For Each mySht In ActiveWorkbook.Worksheets
mySht.Select
ActiveSheet.ChartObjects(1).Activate
myRef = ActiveChart.SeriesCollection(1).Formula
iStrStart = InStr(1, myRef, "!") + 1
iStrEnd = InStr(iStrStart, myRef, ",") - 1
myAdd = Mid(myRef, iStrStart, iStrEnd - iStrStart + 1)
MsgBox "I will now sort the range " & _
Range(myAdd).Address(False, False, xlA1, True)
Range(myAdd).Sort Range(myAdd)(1), xlDescending, Header:=xlYes
Next mySht
End Sub

"Mark1" wrote in message
...
Anybody know how I can reference an array that's values will be equal to

the
values that a chart is using? Here's what I'm attempting to do and I

don't
know if it's possible:

I've got a bunch of sheets and a chart on each one. The data series

values
on each chart is set to a range of cells in each sheet. I want to sort

that
range of cells from highest to lowest on each sheet. The problem is that

the
range on one page doesn't have anything in common with the range on the

next
page except that they are both used in their respective Charts as the data
series values. So, I can't loop through each page and say sort
Range("A1:A5") because on the next page it might be Range("B1:B5") that

needs
to be sorted. They don't have the same column heading either. So, I need

to
loop through each page and tell VBA to SORT THE DATA THAT THE CHART ON THE
CURRENT PAGE IS USING. 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
Format numbers in chart datatable MB Charts and Charting in Excel 3 May 29th 05 03:37 PM
Pivot Chart: cannot apply the default chart type... doco Charts and Charting in Excel 1 January 17th 05 04:55 PM
Comparing charts dynamically Fysh Charts and Charting in Excel 3 December 16th 04 09:02 PM
3 cells are named - how to refere to them in one reference field in a chart Marie J-son Charts and Charting in Excel 2 December 2nd 04 04:52 PM
Extending a Chart Data Series from an Array - Can it be done? Jon Peltier Charts and Charting in Excel 4 November 30th 04 03:30 AM


All times are GMT +1. The time now is 02:16 PM.

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

About Us

"It's about Microsoft Excel"