![]() |
Changing Data and Charts
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 |
Changing Data and Charts
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" wrote in 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. Thanks to all and happy holidays. Craig |
Changing Data and Charts
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. Thanks to all and happy holidays. Craig . |
All times are GMT +1. The time now is 10:39 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com