+ Reply to Thread
Results 1 to 4 of 4

Variable reference for generating Chart sheet

  1. #1
    Registered User
    Join Date
    02-12-2012
    Location
    Victoria
    MS-Off Ver
    Excel 2010, Excel 2013/64
    Posts
    23

    Variable reference for generating Chart sheet

    Hi,

    I'm almost too embarrassed to ask this one.. but I can't work it out.

    I have
    Please Login or Register  to view this content.
    This works fine if data is in A1:A6 and H1:H6 on the 'Basic Info' worksheet.. however my VBA generates a 'Basic Info' sheets with sometimes more, or less rows. So this range needs to be adaptive.
    I know how to make a single range variable using a row count, but here the chart references two ranges separated by a comma (first range for X, second range for Y).
    That's what's tripping me up.

    I can't get the syntax right.. as I don't know how to deal with the Parentheses and the discrete worksheet reference..

    I tried substituting

    Please Login or Register  to view this content.
    for
    Please Login or Register  to view this content.
    but the VBA is incorrect, i know this, the second set of Parentheses kill it. I don't know how the second range should be correctly referenced
    This is really bugging me, and I've looked far and wide but not found anything that helps me with these two ranges in a single argument.

    I'm a VBA hack with clearly no formal training, and I make do using examples and modifying them. It shows here!
    Thanks for any help.

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Variable reference for generating Chart sheet

    Hi kabammi,

    Try this:

    Please Login or Register  to view this content.
    HTH

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Registered User
    Join Date
    02-12-2012
    Location
    Victoria
    MS-Off Ver
    Excel 2010, Excel 2013/64
    Posts
    23

    Re: Variable reference for generating Chart sheet

    Thanks Robert,

    You are a gentleman and a scholar!

    all the best!

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Variable reference for generating Chart sheet

    Thanks Robert,

    You are a gentleman and a scholar!
    No, not at all but thanks for the feedback

    I'm glad we were able to provide you with a solution.

    Regards,

    Robert

+ 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