Results 1 to 2 of 2

Macro to automatically do equation and plot the graph with correct formatting and trendlin

Threaded View

  1. #1
    Registered User
    Join Date
    10-08-2020
    Location
    Michigan
    MS-Off Ver
    MS Office 365
    Posts
    19

    Macro to automatically do equation and plot the graph with correct formatting and trendlin

    Hello All,

    I am relatively new to writing macros. I have several excel files that have a time, displacement, voltage and current column. I need to calculate a velocity column. "Velocity" in cell E1. "mm/s" in cell E2. And "(B4-B3)/(A4-A3) in cell E3 and it needs to go all the way down for however many rows the data set has. Each file has a different amount of rows of data since these are time based data sets. I then need to graph the data titled "Velocity" with velocity on the y-axis and displacement on the x-axis. Then, current on a secondary y-axis and displacement on the x-axis. Then I need to add a trendline to the velocity graph with a moving average with a period of 5. Axis titles, legend, and graph title need to be added. The graph title should be "Job 8305 (NextLine) Motor Bridge Ramp Test (NextLine) (Name of the excel file)". Then, the velocity data series can be hidden from the graph and the legend so you only see the solid trendline.

    I started writing the macro in portions by using the macro recorder but was not able to successfully add the trendline.

    I attached 2 files. 1 File is a raw file, the next is a processed one which is how we want it to look when it is finished. Could someone help me to achieve this goal?

    If the trendline part is too difficult to add, it can be left out if need be.

    Thank you so much!!
    Attached Files Attached Files
    Last edited by ksterling; 05-11-2022 at 02:58 PM. Reason: Include Attachments

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Scatter Plot Graph not showing correct result
    By Peter Niklas in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-09-2021, 07:26 AM
  2. How can I plot the correct line graph from my data?
    By mmsood99 in forum Excel General
    Replies: 1
    Last Post: 05-22-2020, 10:28 PM
  3. Plot graph for complex equation based on a range of X values
    By KevCroft in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-21-2019, 02:50 PM
  4. Dynamic graph plot automatically extending the x axis
    By FilipeF in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2018, 04:29 AM
  5. [SOLVED] Equation(s) That Will Automatically Find Bad Data And Correct It.
    By garrett.grillo in forum Excel General
    Replies: 3
    Last Post: 10-26-2012, 04:16 PM
  6. link data to a drop down box and automatically plot a graph
    By duaplex in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-05-2011, 04:45 AM
  7. How to plot a graph from an equation
    By tee in forum Excel General
    Replies: 4
    Last Post: 03-08-2005, 12:06 AM

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