+ Reply to Thread
Results 1 to 4 of 4

Setting source data for chart

  1. #1
    Registered User
    Join Date
    01-07-2010
    Location
    South Carolina
    MS-Off Ver
    Excel 2007
    Posts
    18

    Setting source data for chart

    Hopefully, there is a really obvious problem here, but I cannot make this thing fly. Can you see what is wrong?

    Background:
    Data is on sheet2. A chart for the data already exists on Sheet3. I am trying to skim down column 3 (column C) on Sheet2 and take only the last 12 data points and use them for the source data for the chart on Sheet3.

    One possible clue is that the original chart had 2 sets of data...one for the numbers and one that was a column of month names for the Y -axis. I am not sure that should make this code illegal though. Anyway, thanks in advance for the help.
    m.hatter

    Please Login or Register  to view this content.
    Last edited by m.hatter; 01-18-2010 at 12:43 PM. Reason: bad title

  2. #2
    Registered User
    Join Date
    01-07-2010
    Location
    South Carolina
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Setting source data for chart

    OK...after this many looks and no comments, maybe the question is not very clear.

    Another example:

    Lets say you have a set of numbers of unknown size all listed in column A of sheet1 of your workbook. How would you create a range object with a value equal to the last 12 used cells in column A?

    I know that counta can be used to figure out which was the last used row in the column, but how to you convert (say) 52 (where 52 is the last used row) to a range equal to something like Range("A40" , "A52").

    I have been trying to use the Cell syntax (which seems a lot more variable friendly) but I cannot make it work. Any help or pointers in the right direction would be greatly appreciated.

    Thanks.

  3. #3
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Setting source data for chart

    How about this? I think you may be misusing the CountA function.
    Please Login or Register  to view this content.
    mRange is this the range that you are interested in.

  4. #4
    Registered User
    Join Date
    01-07-2010
    Location
    South Carolina
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Setting source data for chart

    All praise to blane245!!!! It worked!!

    Thanks a lot!!! This has been the maddest I have been at a computer in a long time. I thought I had advanced beyond such noobisms.

    I am extremely new to Excel, .end and .address and pretty friggin' handy. Hard to ask about something you have never seen before. Thanks again.!

    Now on to other chart problems!


    m.hatter

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.6.0 RC 1