Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Barchart.datasource =A1:C4???

Status
Not open for further replies.

kingz2000

Programmer
May 28, 2002
304
DE
Hi,

I have an excelfile with a barchart whereby I am trying to dynamically fill the datasource of a diagram with my code. Assuming the diagram values& column headings are in the range A1:C4.HOw can I allocate the datasource of the Chart to this range per code???


 
Have you tried to play with the macro recorder ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

no. I was assuming it would be quite a straight forward code. like micrisft.chart.datasource or somehting. I have never tried the makro thing.
 


As PHV suggested, macro record setting the series data source.

THEN observe the code that the recorder generated.

Alternatively, I like to use Named Ranges for my source data if the range will continually change. Check out How can I rename a table as it changes size faq68-1331 for the OFFSET workbook function. The range name can be used in the Series X & Y values in the form...
[tt]
=MySheet!MyRangeName
[/tt]
No VBA required.

Skip,

[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
POULTRY in motion to PULLET for a PALTRY amount! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top