+ Reply to Thread
Results 1 to 3 of 3

VBA to blow away any and all trendlines in a chart

  1. #1
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    615

    VBA to blow away any and all trendlines in a chart

    Good Afternoon All!

    I use the following to blow away any present data series in a particular chart:

    Please Login or Register  to view this content.
    Is it possible to do the same for any trendlines instead?

    What I am doing is providing the user with radio (option) buttons to select which of three data series lines present on a chart they want displayed. Before running the code to display the trendline, I want to clear all trendlines, if present (which brings up another question - do I have to first test for the presence of the trendline or can I just use "On error resume next" for the cycling?). I have found it cleaner to do this instead of including the "If the button is false, then delete the trendline" method.

    In any circumstance, able to help or not, HAPPY SUNDAY!

  2. #2
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    615

    Re: VBA to blow away any and all trendlines in a chart

    Though I have come up with the following, I am wondering if there is a way to address the trendlines without the clumsy cycling of each data series-

    Please Login or Register  to view this content.

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

    Re: VBA to blow away any and all trendlines in a chart

    What makes you think it's clumsy?

    Trend lines are objects of a series so the code you have is correct
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Adding trendlines to a chart while using a macro
    By cainer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-26-2009, 07:14 AM
  2. [SOLVED] Enter multple trendlines on the same chart.
    By kirbyre in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-28-2006, 08:45 PM
  3. [SOLVED] What's equation for R-Squared value given for chart trendlines?
    By Sarah in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-09-2006, 07:15 AM
  4. two scatter plots with two trendlines on one chart
    By Leo Bueno in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-13-2005, 08:50 PM
  5. Summing trendlines in an excel chart?
    By simonpitt in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-06-2005, 08:58 PM

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