I like to use Option Explicit (I need all the help I can get)
1. I wasn't going to lecture my opinion, but the version below works without Option Explicit, but all the variables (all un-Dim-ed) default to Variant type, and I prefer to have them strongly typed so that if I accidently try to assign a String to a valiable that should only be Long, it'll tell me
The other reason is that I might make a typo with a variable that takes forever to track down
sMsg = "This is a bad thing to do"
...
...
...
...
...
If x = 0 then
Msgbox sMgs
...
..
..
Public Function DecDegrees() As Variant
DecDegrees = CVErr(xlErrNum)
Application.Volatile ' look in Help
On Error GoTo NiceExit
Set R = Application.Caller ' cell with this function in
D = R.Offset(0, -3).Value ' 3 to the left, etc.
M = R.Offset(0, -2).Value
S = R.Offset(0, -1).Value
'Decimal degrees = degrees + minutes/60 + seconds/ 3600
DecDegrees = D + M / 60# + S / 3600# ' # = double i.e. 3600.0 --> 3600#
Exit Function
NiceExit: End Function
2. You should be able to edit a post to correct a typo (I have to do it all the time since my keyboard insists on making dumb mistakes)
There should be an [Edit Post] buttom below right