+ Reply to Thread
Results 1 to 3 of 3

Thread: Select data from a range that moves over every month

  1. #1
    Registered User
    Join Date
    04-01-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    57

    Select data from a range that moves over every month

    I have a pie chart and the source data moves 1 space over to the right every month as I add a new column to the left of the data. The data is names along with percents. Arranged like this:

    Cash Stocks Bonds
    20% 45& 25%

    There is a cell called "Current Mo.", which is in the previous column and 1 row up from the word "cash". The active sheet is called "detail" and the piechart is the top chart along with 3 others in a sheet called "graph"

    I tried to figure out how to do this using the macro recorder, but am getting an error. Here's what I have:

    Sub Macro2()
    '
    ' Macro2 Macro
    '
    
    '
    Dim PieChartValues As Range
    
    Cells.Find(What:="current mo.").Activate
    Set PieChartValues = ActiveCell.Offset(1, 1).Range("A1:E2")
    
    With Sheets("Graph")
        .ChartObjects("Chart 5").Activate
        .ChartObjects("Chart 5").Activate
        .SetSourceData Source:=Sheets("Detail").Range(PieChartValues)
    End With
    
    End Sub

  2. #2
    Registered User
    Join Date
    04-01-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Select data from a range that moves over every month

    Should I post this in another area?

  3. #3
    Registered User
    Join Date
    04-01-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Select data from a range that moves over every month

    Is there any more info that you need?

+ 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.2.0