Changing Data and Charts

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Excel 2000 / WIN2K
===========================================================
Thanks for looking at my request.

I have a workbook with 2 sheets in it. Sheet1 is called "RawData" and Sheet2 is called "Chart". Whern you start Excel and open the book, a opopup form asks you for a date range. Once you enter a valid date range, I query SQL Server and extract the proper data and return it to RawData sheet. The number of columns remains the same but the rows can be from none to thousands.

My question is how can I setup the Chart sheet to handle the changing dataset ?

I'm an excellent VB programmer but cannot figure out the proper object to use to manage the chart and data.

Thanks to all and happy holidays.

Craig
 
I just recorded a macro while changing the ranges. I've modified the Range
definition though.

ActiveChart.SeriesCollection(1).XValues = Range("A1:A500")
ActiveChart.SeriesCollection(1).Values = Range("B1:B500")


Craig Somberg said:
Excel 2000 / WIN2K
===========================================================
Thanks for looking at my request.

I have a workbook with 2 sheets in it. Sheet1 is called "RawData" and
Sheet2 is called "Chart". Whern you start Excel and open the book, a opopup
form asks you for a date range. Once you enter a valid date range, I query
SQL Server and extract the proper data and return it to RawData sheet. The
number of columns remains the same but the rows can be from none to
thousands.
My question is how can I setup the Chart sheet to handle the changing dataset ?

I'm an excellent VB programmer but cannot figure out the proper object to
use to manage the chart and data.
 
The object you need is the ChartObjects("chartname").Chart
and use the SeriesCollection().Values property
or the .XValues property
Make sure that the ranges are not empty or that will cause
you lots of grief

To change the axes scaling, use the .Axes(xlCategory) or
..Axes(xlSeries) or .Axes(xlValues) objects
and their .MinimumScale and .MaximumScale properties
(but make sure that .MinimumScale < .MaximumScale as you
change them)

Kevin Beckham
-----Original Message-----
Excel 2000 / WIN2K
========================================================== =
Thanks for looking at my request.

I have a workbook with 2 sheets in it. Sheet1 is
called "RawData" and Sheet2 is called "Chart". Whern you
start Excel and open the book, a opopup form asks you for
a date range. Once you enter a valid date range, I query
SQL Server and extract the proper data and return it to
RawData sheet. The number of columns remains the same but
the rows can be from none to thousands.
My question is how can I setup the Chart sheet to handle the changing dataset ?

I'm an excellent VB programmer but cannot figure out the
proper object to use to manage the chart and data.
 
Back
Top