Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7404835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:18:45+00:00 2026-05-29T05:18:45+00:00

At work, I have made a macro to format and chart out data that

  • 0

At work, I have made a macro to format and chart out data that comes from testing the parts we make. The values have to be within a certain range, so I would like to add lines to the charts denoting where the tolerance limits are.

For example, one parameter is a voltage value for a certain signal. It must be between .271 and .451 to be in spec, so I would like to add lines at those values on that chart.

Other charts are measuring different things and would have different values, but the basic principle is the same.

The number of data points per signal is not the same, but is usually quite large, around a couple thousand each.

I have found a couple of different options around the internet involving the drawing tools or adding a new data series to the charts, but I am not well versed in those aspects of excel macros. In fact, I don’t think I can find the page that I first found the data series idea at.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:18:46+00:00Added an answer on May 29, 2026 at 5:18 am

    A new series for each line is the best approach.

     'add a line series with line but no markers
        Sub AddLineSeries(cht As ChartObject, sName As String, xvals, _
                           yvals, SeriesColor As Long)
            Dim s As Series
            Set s = cht.Chart.SeriesCollection.NewSeries
            With s
                .Name = sName
                .Values = yvals
                .XValues = xvals
                .MarkerBackgroundColor = xlNone
                .MarkerForegroundColor = SeriesColor
                .MarkerStyle = xlMarkerStyleNone
                With .Border
                    .Weight = xlThin
                    .Color = SeriesColor
                End With
            End With
        End Sub
    

    Usage (adding one line for each cut-off):

    'cht is the chart object
    'minX/maxX are x-axis values you want to plot the line for
    'qcMin/Max are the y-axis values for your lower/upper cut-offs
    'Array() just creates an array of values to pass to the chart for plotting, since
    '   we're not using values from a worksheet for this series
    AddLineSeries cht, "QC Min", Array(minX, maxX), Array(qcMin, qcMin), _
                  RGB(255, 0, 0)
    AddLineSeries cht, "QC Max", Array(maxX, maxX), Array(qcMax, qcMax), _
                  RGB(255, 0, 0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made this function, that seems to work fine, but it return #
I have made some code that makes powerpoint and excel work together. And I
I have made a nibble class that appears to work, but when I use
I have made a foreground service that work with a runnable object that is
I have made this code for giving out +1 point, but it doesn't work
More of a design/conceptual question. At work the decision was made to have our
At work we have a legacy process written in Visual C++ that basically consists
I have made some menu with a slide down submenu. It should work fine
I have made a jQuery plugin that works fine when applied to a single
I have made this piece of code that makes a roll hover effect on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.