+ Reply to Thread
Results 1 to 4 of 4

updating data range for column charts in VBA

  1. #1
    Registered User
    Join Date
    10-25-2009
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    2

    updating data range for column charts in VBA

    hi,

    i'd like to ask about my macros regarding updating the data range for my column charts after inserting a new row with a few column values.

    i tried to record a macro by selecting the existing column chart i had and changing its data range to the new data range (shift+ctrl+down). however, each time i add in a new row, the data range for the column chart is not updated automatically when i click the button with the assigned macro.

    is there any way i can go about doing this?

    thanks!

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

    Re: updating data range for column charts in VBA

    Why not post the code you have and the workbook explain exactly what you do to add data and then run your code.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    10-25-2009
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: updating data range for column charts in VBA

    Sub updateandview4weekgraph1()
    '
    ' updateandview4weekgraph1 Macro
    '

    '
    Sheets("4-week graph").Select
    ActiveSheet.ChartObjects("Chart 1").Activate
    ActiveChart.SeriesCollection(1).Name = "=""No. of Failure"""
    ActiveWindow.SmallScroll Down:=-141
    End Sub

    this is what i have but i recorded macro and i didn't type the code in.
    1) so basically i would click on the '1st macro' which updates the data range i have by one additional row at the bottom.
    2) therefore, i created this macro, which i start from another sheet and then go to '4-week graph' tab where the graph is. i already have a graph with the old data, and i'll right click-> 'select data' and then i'll shift+control+right+down to select the entire new data range with one updated row.
    3)i'll then stop my recording after that.

    is this okay? sorry im not very sure if this description helps coz it's the 1st time i'm posting sth here. thanks anyway!

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

    Re: updating data range for column charts in VBA

    Please add code tags to your post.

    Can you post example workbook?

+ 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