Results 1 to 5 of 5

VBA Dynamic Range - An Indirect Cell Reference

Threaded View

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    3

    VBA Dynamic Range - An Indirect Cell Reference

    I have a chart that I want to produce from a variable table range.
    the range is cell GraphData!A26 which is fixed, and cell B24 contains a computed value for the end range i.e. GraphData!M29, which when linked as an indrect cell works great.

    I am trying to create a macro for a button to update the graph as if different options are selected then the graph range changes.

    So far I have this:

    Sub UpdateSpendGraph()
    
        ActiveSheet.ChartObjects("Chart 117").Activate
        ActiveChart.ChartArea.Select
        ActiveChart.PlotArea.Select
        ActiveChart.SetSourceData Source:=Sheets("GraphData").Range("A26:" & Range("B24").Value).Select, _
            PlotBy:=xlRows
    
    End Sub
    I am having trouble with the range, after looking at other threads i've tried Range("A26:" & Range("B24").Value).Select however it isn't working.

    Any help would be great, thanks
    Last edited by JosephP; 01-10-2013 at 10:06 AM. Reason: add code tags-please learn to use them!

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