how make an angle to show in degree, minute,second instead of degree

  • Thread starter Thread starter EXCEL$B!!(BNEWS
  • Start date Start date
E

EXCEL$B!!(BNEWS

hi,

i wonder how to change an angle to show in degree, minute,second instead of
degree in excel

i mean, for instance, make 45.5 (degree) to 45.3000 (d m s)

thanks
 
Here is one way...

DecimalDegrees = 45.5
DegreesMinutesSeconds = Int(DecimalDegrees) & Format((DecimalDegrees - _
Int(DecimalDegrees)) / 24, "\.nnss")

Rick
 
Thanks a lot

Rick Rothstein (MVP - VB) said:
Here is one way...

DecimalDegrees = 45.5
DegreesMinutesSeconds = Int(DecimalDegrees) & Format((DecimalDegrees - _
Int(DecimalDegrees)) / 24, "\.nnss")

Rick
 
You are welcome. As it turns out, we can simplify the expression somewhat..

DecimalDegrees = 45.5
DegreesMinutesSeconds = Int(DecimalDegrees) & _
Format(DecimalDegrees / 24, "\.nnss")

Rick
 
Back
Top