Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Setting Chart Data points with an array?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 03-07-2012
Member
 
Join Date: Jun 2012
Posts: 3
Setting Chart Data points with an array?
  

I have a piece of code (vba) that goes through each row and gives it a graph (this works), however, due to the nature of the spreadsheet (Excel) I am working in, there may be as few as 2-5 data points and up to 20. Because of this, I can not simply hard code the columns of data and let the row number change as I previously had it. I have set up a selectcase statement that takes the two defining column factors, subtracts them and gives me how many columns I need that then inputs the correct amount of "A" & Row# & ",B" & Row# etc, into a string, however when I use the ActiveChart.SetSourceData Source:=Range(ColumnAmtStr) statement I get either an error of 448 "Named argument not found" or 1004 "Method 'Range of object '_Global' failed".

Any words of advice?

Reply With Quote
  #2  
Old 03-07-2012
Member
 
Join Date: Dec 2007
Posts: 2,260
Re: Setting Chart Data points with an array?

Can you go in the VBE, do Tools > References, and look to see if one of the checked references (which are all at the top of the list) starts with MISSING. Try to just uncheck it and see if the error disappeared. If that doesnt work then create a new module and put the code in there instead of the worksheet.
Reply With Quote
  #3  
Old 03-07-2012
Member
 
Join Date: Jun 2012
Posts: 3
Re: Setting Chart Data points with an array?

I found out that the problems were:

A.) I was using a String rather than a Range

B.) I did not include the sheet it was meant to get said data points from.

C.) I used "ActiveChart.SetSourceData Source:=Range(ColumnAmtStr)" when the correct format for a Range object was
"ActiveChart.SetSourceData Source:=ColumnAmtStr"

This one is as good as solved! Thanks for the help though.

Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Setting Chart Data points with an array?"
Thread Thread Starter Forum Replies Last Post
There is no data in Excel Pie Chart Tarani MS Office Support 2 25-02-2012 11:27 AM
Data points in Excel chart not lining up with axis mbbackus MS Office Support 1 10-01-2012 10:58 AM
Setting up RADIUS on Server 2008 R2 with DD-WRT access points Kordell Operating Systems 5 22-08-2010 02:45 AM
How to Create, edit or delete an array formula or Pivot Chart agarwalm11 Guides & Tutorials 1 31-12-2009 11:22 AM
Mark data points in Excel line chart Amie Windows Software 3 11-06-2009 07:50 PM


All times are GMT +5.5. The time now is 03:26 PM.