Results 1 to 3 of 3

Convert geographical coordinates to degree

Threaded View

  1. #1
    Registered User
    Join Date
    11-08-2014
    Location
    Malaysia
    MS-Off Ver
    2010
    Posts
    84

    Lightbulb Convert geographical coordinates to degree

    Hello members !
    I have 2 columns of geographical coordinates in following format : Lat: 01 28 15 Long: 104 15 10
    and I need to convert these 2 columns to degree : Lat: 1.47 Long: 104.25
    I found this code from microsoft support page for the case that coordinates come with degree ° minute ' and second " signs. However, in my case, I don't have these signs.

    Function Convert_Decimal(Degree_Deg As String) As Double
       ' Declare the variables to be double precision floating-point.
       Dim degrees As Double
       Dim minutes As Double
       Dim seconds As Double
       ' Set degree to value before "°" of Argument Passed.
       degrees = Val(Left(Degree_Deg, InStr(1, Degree_Deg, "°") - 1))
       ' Set minutes to the value between the "°" and the "'"
       ' of the text string for the variable Degree_Deg divided by
       ' 60. The Val function converts the text string to a number.
       minutes = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "°") + 2, _
                 InStr(1, Degree_Deg, "'") - InStr(1, Degree_Deg, _
                 "°") - 2)) / 60
        ' Set seconds to the number to the right of "'" that is
        ' converted to a value and then divided by 3600.
        seconds = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "'") + _
                2, Len(Degree_Deg) - InStr(1, Degree_Deg, "'") - 2)) _
                / 3600
       Convert_Decimal = degrees + minutes + seconds
    End Function
    Thank you
    Last edited by Moriexcel; 02-06-2015 at 09:47 AM. Reason: changed to solved

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Cheking for close geographical points by geographical coordinates
    By simone77 in forum Excel General
    Replies: 6
    Last Post: 07-04-2014, 10:34 AM
  2. Convert Coordinates. Degree Minute.decimal to degree.decimal
    By stewman in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-03-2013, 07:37 PM
  3. Replies: 3
    Last Post: 05-25-2012, 03:16 AM
  4. [SOLVED] Radar Plot using geographical coordinates
    By David in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-02-2005, 09:05 AM
  5. Radar Plot using geographical coordinates
    By David in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-31-2005, 04:05 PM

Tags for this Thread

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