+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    05-25-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    1

    Post Help Needed to remove version dependency

    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.

  2. #2
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,447

    Re: Help Needed to remove version dependency

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0