The information in this article applies to:
SUMMARY
Fractions of a degree are commonly expressed in units called minutes and
seconds. One degree is equivalent to 60 minutes, and similarly, one minute
equals 60 seconds. These units are most commonly used for expressing a
navigational point such as a point on a nautical chart.
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.asp Converting Decimal Degrees to Degrees/Minutes/SecondsThe following Microsoft Visual Basic for Applications custom function accepts an angle formatted as a decimal value and convert it to a text value displayed in degrees, minutes, and seconds.
To use this function, create a conversion formula, as in the following
example:
This formula will return 10~ 27' 36" (that is, 10 degrees, 27 minutes, 36
seconds).
Converting Degrees/Minutes/Seconds to Decimal DegreesThe following Microsoft Visual Basic for Applications custom function accepts a text string of degrees, minutes and seconds formatted in the exact same format that the Convert_Degree function returns (for example, 10~ 27' 36") and converts it to an angle formatted as a decimal value. This is exactly the reverse of the Convert_Degree custom function.WARNING: This custom function fails if the Degree_Deg argument does not follow the format of the following:
as stated earlier.
To use this function, create a conversion formula, as in the following
example:
This formula will return 10.46 (that is, 10.46 degrees).
NOTE: You are required to type three quotation marks (""") at the end of argument of this formula to balance the quotation mark for the seconds and the quotation mark for the text string. REFERENCESFor additional information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base: Q163435 VBA: Programming Resources for Visual Basic for Applications Additional query words: 5.00a 5.00c 7.00a 97 XL97 XL7 XL5
Keywords : kbprg kbdta kbdtacode PgmOthr PgmHowto KbVBA |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |