+ Reply to Thread
Results 1 to 2 of 2

Assigning variable values to Values and XValues

  1. #1
    Registered User
    Join Date
    04-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Assigning variable values to Values and XValues

    Hello, I'm new and I am trying to understand the syntax or data types when assigning a range to XValues and Values in the SeriesCollection.

    Consider this code which is from a recorded macro and works just fine:
    Please Login or Register  to view this content.
    Now I am trying to replace the constant for Values and XValues with a string value:

    Please Login or Register  to view this content.
    The code breaks at the red highlighted line even though in the watch window the string value of ValueString is identical to "='1YearByProduct'!$B$3:$M$3"

    Please advise. I'm puzzled. I appreciate your input.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Assigning variable values to Values and XValues

    Assuming your code is exactly as posted the issue is the naming of your variables.

    You build the range reference in a variable called ValuesString but in the assignment to the series Values property you use ValueString
    Those are 2 separate variables.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

+ 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