+ Reply to Thread
Results 1 to 11 of 11

Graphing macro works in 2003 but doesn't have some features in 2007

  1. #1
    Registered User
    Join Date
    06-11-2012
    Location
    Iowa, United States
    MS-Off Ver
    Excel 2007
    Posts
    15

    Graphing macro works in 2003 but doesn't have some features in 2007

    I am having difficulty with a graphing macro. The macro was written for Excel 2003; however, I am now using the program on Excel 2007 and some of the features do not function in 2007. The macro was written to make trendlines of a certain set of data, there used to be an option that would allow you to choose the color of the trendline as well as the type of trendline you wanted (ie linear, polyfit). Can anyone help me figure out what may have happened and a possible solution?
    Thank You

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Graphing macro works in 2003 but doesn't have some features in 2007

    Hi,

    You'll need to post the macro that you say isn't working.

    Trendlines can be changed to a different type and of course the colour can be varied.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    06-11-2012
    Location
    Iowa, United States
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Graphing macro works in 2003 but doesn't have some features in 2007

    Here are the subroutines and functions. I didn't write the macro, so I'm not 100% sure what's going on. It seems as if chosing what type of trendline is working, but I'm not sure how to handle the part where it asks what color you want it to be.
    Thank You

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Graphing macro works in 2003 but doesn't have some features in 2007

    Hi,

    In your TrendALineAuto procedure include code like the following. I've also included the trendline weight and style. Just delete if not necessary.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-11-2012
    Location
    Iowa, United States
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Graphing macro works in 2003 but doesn't have some features in 2007

    Is there anyway to get the macro to pause at the format trendline screen so that I can manually choose which line fit I want and then choose which color I want manually? The biggest thing I am doing is I am updating about 30 plots and I do not want to have to manually go in and add a trendline and then format it by hand. I want to be able to just have one "Format Trendline" box, where I can select the line fit and the line color/style, that will update all the plots with the trendline I have selected.
    Thank You
    Last edited by mgphill; 08-01-2012 at 08:29 AM.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Graphing macro works in 2003 but doesn't have some features in 2007

    Hi,

    Perhaps the easiest way would be to have a couple of Data Validation drop down cells, one containing a list of trendline types and the other a list of colours. Then read those cell values in the macro rather than have them hard coded.

    Regards

  7. #7
    Registered User
    Join Date
    06-11-2012
    Location
    Iowa, United States
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Graphing macro works in 2003 but doesn't have some features in 2007

    If you step through the macro step by step, the following lines display the "format trendline" screen. I was wondering if I'd be able to just select the desire items in that screen and then have those apply to all the plots. Do you think that could work?
    Thank You


    Please Login or Register  to view this content.

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Graphing macro works in 2003 but doesn't have some features in 2007

    Hi
    If I understand your request to be to capture the trendline type and then use that on all chart objects on a sheet then something like the following.

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-11-2012
    Location
    Iowa, United States
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Graphing macro works in 2003 but doesn't have some features in 2007

    Is there a way to pause the macro so I can select the features I want from the "format trendline" screen? Like could it pause until I have selected the stuff I would like and then I could press enter to have the macro continue? Thank You

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Graphing macro works in 2003 but doesn't have some features in 2007

    Quote Originally Posted by mgphill View Post
    Is there a way to pause the macro so I can select the features I want from the "format trendline" screen? Like could it pause until I have selected the stuff I would like and then I could press enter to have the macro continue? Thank You
    ...have you tried the code?

    That's exactly what the line
    Application.Dialogs(xlDialogChartTrend).Show

    does.

  11. #11
    Registered User
    Join Date
    06-11-2012
    Location
    Iowa, United States
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Graphing macro works in 2003 but doesn't have some features in 2007

    That is what brings the dialog box up, but when I just run the macro, that box doesn't stay up long enough for me to click what I want.

+ 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