View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nick Hebb Nick Hebb is offline
external usenet poster
 
Posts: 162
Default Formatting for Degrees Minutes and Seconds

formDMS = d & Chr(&HB0) & " " & im & "' " & s & """"

You can get the unicode hex number (B0 in this case) for a symbol from
the Insert Symbol dialog box. Take the number and prefix it with &H
to put it in VB Hex form. then convert the number to a character with
the Chr() function.

Or, just that little degree symbol that you just inserted in your post
above, copy it, and paste it into your VBA editor. Or just copy the
following line:

formDMS = d & "° " & im & "' " & s & """"

I just tried it. It works too. :-)

----
Nick Hebb
BreezeTree Software
http://www.breezetree.com