+ Reply to Thread
Results 1 to 3 of 3

Need help to set Chart to select data that doesnt have a fixed column position.

  1. #1
    Registered User
    Join Date
    04-05-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Need help to set Chart to select data that doesnt have a fixed column position.

    hye everyone,

    I am creating a chart that pulls data from different columns. Usually the no. of columns dont change but when they do, the chart messes up.

    Does anyone know a way to setup the chart in a way that it selects data in the whole column range based on the top header "name" instead of hard wired to seek e.g $c$1 all the time?

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Need help to set Chart to select data that doesnt have a fixed column position.

    Use a secondary table from which you can drive your chart and put the data into that table from your main table, maybe using some form of selection criteria.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    04-05-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Need help to set Chart to select data that doesnt have a fixed column position.

    My macro is coded to take from that single table, if I make another table, im afraid it will mess up. The data is quite big. But I'll try your suggestion for now.

    To elaborate.. referring to the code below, I'd like the chart to search for the header of the column instead of the column address. So it changes from

    ActiveChart.SeriesCollection(1).XValues = "='Sheet1'!$A$5:$A$23" to something like
    ActiveChart.SeriesCollection(1).XValues = = Sheet1! "Total Sales"

    Please Login or Register  to view this content.

+ 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