Results 1 to 20 of 24

Thread: Solved: Updating Charts in VBA with listbox

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Contributor
    Joined
    Nov 2007
    Posts
    144
    Location

    Solved: Updating Charts in VBA with listbox

    Hey again,

    I am trying to create a chart that automatically refreshes depending on a value selected from a listbox1.

    Both listbox1 and chart are on sheet1

    Listbox contains list of names from sheet "Fee Earning Stats"

    In this sheet, beside each name is 6 columns of data

    Is it possible to have the chart on sheet1 refresh each time I click a name in the listbox1.

    The code would probably have to store the selected listbox value, search through the "Fee Earning Stats" sheet for that name and select the 6 columns beside that particular name.

    Is this possible??

    My VBA is starting to get better but charting in code is still a mystery.

    Below is an example of code where I manually selected 6 columns of data for a name selected in the listbox

    [vba]ActiveSheet.ChartObjects("Chart 77").Activate
    ActiveChart.SeriesCollection(1).Select
    ActiveChart.SeriesCollection(1).XValues = "='Fee Earning Stats'!R5C5:R5C10"
    ActiveChart.SeriesCollection(1).Values = "='Fee Earning Stats'!R30C5:R30C10"
    ActiveChart.SeriesCollection(2).XValues = "='Fee Earning Stats'!R5C5:R5C10"
    ActiveChart.SeriesCollection(2).Values = "='Non Fee Earning Stats'!R30C5:R30C10"
    ActiveWindow.Visible = False
    Windows("Book1.xls").Activate[/vba]
    Last edited by f2e4; 06-03-2008 at 08:22 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •