Consulting

Results 1 to 3 of 3

Thread: Solved: Chart Help

  1. #1
    VBAX Regular
    Joined
    May 2006
    Posts
    35
    Location

    Solved: Chart Help

    I have 6 Charts on a worksheet. I want to change their production/editing to vba. I do not know where to start. I have code on creating charts, but I can not seem to find code on editing charts or do I have to write code to create the entire page?

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    I would suggest using the macro recorder, then manually making the changes you want, then refer to the code that was created and use that to build the real code.

    Or if you have a specific questions you can post it and we can help.

  3. #3
    VBAX Regular
    Joined
    May 2006
    Posts
    35
    Location
    [VBA]ActiveChart.SeriesCollection(1).Values = Range(Sheets("YTD").Cells(Row, Col), (Sheets("YTD").Cells(Row, LCol)))
    ActiveChart.SeriesCollection(1).Name = Sheets("YTD").Cells(Row, 1)
    ActiveChart.SeriesCollection(1).XValues = Range(Sheets("YTD").Cells(1, Col), Sheets("YTD").Cells(1, LCol))
    [/VBA]

    Recording macros doesnt really help since there is so much "understood" syntax. Using the above code, this updates the x,y names and data ranges, then I repeat by looping through all the charts. The prerequisite to this is to have a template chart created already.

Posting Permissions

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