Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there folks.
I am trying to format Degrees expressed as a decimal amount as Degrees Minutes Seconds The [h]:mm:ss format given in the custom section of the "Format Cells" dialogue box does only a tolerable job and I need to divide the Decimal Degrees by 24 first, in order to achieve that. So... in order to achieve my goal I have decided to write my own UDF. Although this does not leave me with an underlying numeric value, (and that is not a real bad thing) I cannot discover a way to insert a ° (°)character into the output string. The function code is as follows: Function formDMS(DecDeg) If DecDeg < 0 Then DecDeg = DecDeg * (-1) d = Int(DecDeg) m = (DecDeg - d) * 60 im = Int(m) s = Round((m - Int(m)) * 60, 0) formDMS = d & ":" & im & "'" & s & """" End Function ---------------^------------------------ it is the character above the "^" that needs to be modified. any ideas... would be appreciated Regards Geoff |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Converting Decimal Degrees to Degrees/Minutes/Seconds | Excel Worksheet Functions | |||
How do you convert decimal degrees to degrees minutes seconds | Excel Discussion (Misc queries) | |||
how can i convert degrees/minutes/seconds to decimal degrees? | Excel Discussion (Misc queries) | |||
calculate from degrees to degrees/minutes/seconds on excel? | Excel Worksheet Functions | |||
converting from digital degrees to degrees minutes seconds | Excel Worksheet Functions |