Hi All,
I have recorded a macro to generate some graphs in excel 2003. The code snippet is as follows:
Code:Charts.Add ActiveChart.ChartType = xlLineMarkers ActiveChart.SeriesCollection.NewSeries ActiveChart.SeriesCollection(1).XValues = "=RawData1!R" + sRowCountStart + "C1:R" + sRowCountEnd + "C1" ActiveChart.SeriesCollection(1).Values = "=RawData1!R" + sRowCountStart + "C8:R" + sRowCountEnd + "C8" ActiveChart.SeriesCollection(1).Name = "=RawData1!R1C8" ActiveChart.SeriesCollection(2).XValues = "=RawData1!R" + sRowCountStart + "C1:R" + sRowCountEnd + "C1" ActiveChart.SeriesCollection(2).Values = "=RawData1!R" + sRowCountStart + "C7:R" + sRowCountEnd + "C7" ActiveChart.SeriesCollection(2).Name = "=RawData1!R1C7"
where sRowCountStart and sRowCountEnd are the variables. Now when I am executing this code with excel 2007 it is giving me the unexpected results where it is selecting all the columns available in RawData1 instead of column 1 and cloumn 7.
Is there any dependency in excel versions? Any help would be much appreciated.
Thanks in advance.
Last edited by amazon; 05-25-2009 at 08:15 AM.
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
I will add them this time
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks