+ Reply to Thread
Results 1 to 3 of 3

Distance between latitude and longitude

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Distance between latitude and longitude

    Hi everyone, really need help right here.
    i've try and make some alteration of the coding to calculate the distance between latitude and longitude from http://www.cpearson.com/excel/latlong.htm with the help from other excel forum user. The coding is as below :

    Please Login or Register  to view this content.
    However, when i try to run the macro, it turn to have
    compile error:
    Argument not optional

    i think it because of the

    Cells(i, 5) = GreatCircleDistance(Lat1, long1, Lat2, long2)

    does not declare all argument from the GreatCicrcleDistance function. but when i put all the arguments to the equation, nothing is happen.

    Actually how to apply the function so it can be use in the excel sheet.?

    Thank you very much in advance.

  2. #2
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Distance between latitude and longitude

    When I run the macro I get no error and it yields values in column E
    '0 0 1 1 3717.237838
    35 40 36 41 3172.351568

    Now I don't know if the answer is correct, but the code you gave is complete.

  3. #3
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Distance between latitude and longitude

    Sorry about double post, something bad is happening here.
    When I run the macro I get no error and it yields values in column E
    '0 0 1 1 3717.237838
    35 40 36 41 3172.351568

    Now I don't know if the answer is correct, but the code you gave is complete.

    I could upload my doc but when I click Select Files, nothing is happening again. Possibly something in this environment.
    Last edited by brynbaker; 11-06-2012 at 05:19 AM.

+ 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