+ Reply to Thread
Results 1 to 16 of 16

One code VBA To calculate the slope of the line and the distance between two lines on

  1. #1
    Registered User
    Join Date
    02-13-2020
    Location
    Mashhad,Iran
    MS-Off Ver
    2010
    Posts
    10

    One code VBA To calculate the slope of the line and the distance between two lines on

    Hi friends . If possible help get a code VBA Write that calculates both the slope of the line and the distance between two lines on the Excel chart . According to the photo I send . Thank you very much friends
    Attached Images Attached Images

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: One code VBA To calculate the slope of the line and the distance between two lines on

    Administrative note

    Welcome to the forum

    in your haste to solve your problem, you probably missed the yellow banner advising how to get answers faster by posting a sheet ?

    Please take a moment to read it and attach a sheet accordingly.

    Thanks you for helping us help you

  3. #3
    Registered User
    Join Date
    02-13-2020
    Location
    Mashhad,Iran
    MS-Off Ver
    2010
    Posts
    10
    I marked the red line in the photo
    Line number ten and fifteen How is the slope of these two lines calculated? Then how the distance between two lines is calculated
    Attached Images Attached Images
    Last edited by HosseinDel1983; 02-13-2020 at 04:20 AM.

  4. #4
    Registered User
    Join Date
    02-13-2020
    Location
    Mashhad,Iran
    MS-Off Ver
    2010
    Posts
    10
    I sent you an example of an Excel file containing the chart
    Attached Files Attached Files
    Last edited by AliGW; 02-13-2020 at 05:02 AM. Reason: Please don't quote unnecessarily!

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: One code VBA To calculate the slope of the line and the distance between two lines on

    Thanks a lot

  6. #6
    Registered User
    Join Date
    02-13-2020
    Location
    Mashhad,Iran
    MS-Off Ver
    2010
    Posts
    10
    Hello my friend .I posted the file in the forum please help me
    Last edited by AliGW; 02-13-2020 at 05:01 AM. Reason: Please don't quote unnecessarily!

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,910

    Re: One code VBA To calculate the slope of the line and the distance between two lines on

    Post the workbook HERE in this thread - attach it to your next post. Your other, duplicate thread has been closed.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Registered User
    Join Date
    02-13-2020
    Location
    Mashhad,Iran
    MS-Off Ver
    2010
    Posts
    10
    Hello my friend . My question is how to calculate the slope of the line and the distance between two lines in the Excel chart
    Last edited by AliGW; 02-13-2020 at 05:01 AM. Reason: Please don't quote unnecessarily!

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,910

    Re: One code VBA To calculate the slope of the line and the distance between two lines on

    I asked you for the workbook. Is it the one you attached to post #4?

  10. #10
    Registered User
    Join Date
    02-13-2020
    Location
    Mashhad,Iran
    MS-Off Ver
    2010
    Posts
    10
    Quote Originally Posted by AliGW View Post
    I asked you for the workbook. Is it the one you attached to post #4?
    This is an example of my workbook. There is a chart in this example .
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    02-13-2020
    Location
    Mashhad,Iran
    MS-Off Ver
    2010
    Posts
    10
    Quote Originally Posted by AliGW View Post
    I asked you for the workbook. Is it the one you attached to post #4?
    Post number four. Example of my question.That's what I want to learn and write code VBA
    At post # 4, I drew two red lines.I want to calculate the slope of line number ten and fifteen . And the distance between the two lines

  12. #12
    Registered User
    Join Date
    02-13-2020
    Location
    Mashhad,Iran
    MS-Off Ver
    2010
    Posts
    10
    Quote Originally Posted by Pepe Le Mokko View Post
    Thanks a lot
    please guide me . How to answer my question

  13. #13
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: One code VBA To calculate the slope of the line and the distance between two lines on

    Administrative Note:

    We don't expect you to bump threads sooner than 24 hours after your last post or more than once a day - it has been only an hour since you posted. Please remember that those who help here do so voluntarily and of their own goodwill. They live in many different time zones and many will be out at work right now if they are not asleep on the other side of the globe. This is not a paid 'service': members will help when they are ready and able to do so, and not 'on demand'. Please do not try to put pressure of time on anyone here: if you get the help you need today, that's fine, but you really should not count on it. Thanks for your understanding and patience.

  14. #14
    Registered User
    Join Date
    02-13-2020
    Location
    Mashhad,Iran
    MS-Off Ver
    2010
    Posts
    10
    Quote Originally Posted by Pepe Le Mokko View Post
    Administrative Note:

    We don't expect you to bump threads sooner than 24 hours after your last post or more than once a day - it has been only an hour since you posted. Please remember that those who help here do so voluntarily and of their own goodwill. They live in many different time zones and many will be out at work right now if they are not asleep on the other side of the globe. This is not a paid 'service': members will help when they are ready and able to do so, and not 'on demand'. Please do not try to put pressure of time on anyone here: if you get the help you need today, that's fine, but you really should not count on it. Thanks for your understanding and patience.


    Thank you very much Yes, I'll wait. I wasn't going to put pressure on anyone. I just want to learn now whenever it happens. And thank you for giving me my message. I wish you the best

  15. #15
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: One code VBA To calculate the slope of the line and the distance between two lines on

    Administrative Note:

    Please don't quote entire posts unnecessarily. They clutter threads and make them hard to read.
    Use the "Quick reply" instead
    Thanks

  16. #16
    Forum Contributor terrypin's Avatar
    Join Date
    01-06-2010
    Location
    East Grinstead, UK
    MS-Off Ver
    MS Office 365
    Posts
    533

    Re: One code VBA To calculate the slope of the line and the distance between two lines on

    Perhaps there's some language problem here. I'm a VBA novice but I don't think you will get a solution from anyone until you provide more information:

    1. The lines' co-ordinate data, not just an image. Any two points on the line (x1,y1) and (x2,y2) will define it.

    2. Clarify what you mean by "...the distance between the two lines". This is not a constant. It depends on which two points you choose as its start and end.

    3. And "...to calculate the slope of line number ten and fifteen" do you mean you want the angle between these two? Or do you want two angles, one for each line? In which case between which axis, x or y? Measured in which direction, clockwise or anti clockwise?

    With that data, I think a VBA expert could write a VBA sub using the appropriate trigonometry!
    Terry, East Grinstead, UK
    Excel 365, Win 10 Pro, i7 PC, 4.0 GHz

+ 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. How I calculate distance 2 colum with VBA code (Radius of the earth in Kilometer)
    By lotto009 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-06-2020, 09:31 AM
  2. VBA Code to determin the change in slope of a line
    By jjjjjjjjunit in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2017, 05:17 PM
  3. [SOLVED] Calculate vertical distance between parallel lines
    By brad.hodge in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-19-2016, 10:53 AM
  4. [SOLVED] VBA code to calculate the distance between point and the regression line
    By Lalikos in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-18-2016, 10:25 AM
  5. calculate maximum distance from a line that intersects a curve
    By DRAGOS ROTARU in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-03-2016, 06:01 AM
  6. Slope, distance, expeculating next point on a line
    By kaiknux in forum Excel General
    Replies: 1
    Last Post: 01-26-2015, 07:57 AM
  7. Calculate distance, offset and height difference from a line to a point
    By Shwgroove in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-16-2014, 05:40 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