NavList:
A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding
Why do we still use this terrible Babylonian hexadecimal system
From: Michael Dorl
Date: 2004 Nov 18, 09:28 -0600
From: Michael Dorl
Date: 2004 Nov 18, 09:28 -0600
Is there anyway to use excel with dd mm ss data? I've been using the following macros to convert back and forth. To add them to a sheet,use TOOLS - MACRO - VISUAL BASIC EDITOR. Then after visual basic stars, do INSERT MODULE and paste them into the resulting window. Mike Function DMStoDEC(s As String) As Double Dim parts() As String Dim Degrees As Integer Dim Minutes As Integer Dim Seconds As Integer Dim sign As Integer parts = Split(s, , , vbBinaryCompare) Degrees = parts(0) If Degrees < 0 Then sign = -1 Degrees = -Degrees Else sign = 1 End If Minutes = parts(1) Seconds = parts(2) DMStoDEC = sign * (Degrees + Minutes / 60# + Seconds / 3600#) End Function Function DECtoDMS(A As Double) As String Dim Degrees As Integer Dim Minutes As Integer Dim Seconds As Double Degrees = Int(A) A = 60 * (A - Degrees) Minutes = Int(A) Seconds = 60# * (A - Minutes) Seconds = Round(Seconds, 3) Seconds = Int(Seconds * 1000#) Seconds = Seconds / 1000# DECtoDMS = Degrees & " " & Minutes & " " & Seconds End Function