function for converting DMS format to Decimal in Microsoft Excel Visual Basic -
i have problems using visual basic in ms. excel. have sort of coordinates data in dms format (longitude , latitude) it's not in usual format. data seems this:
e 103 29 12.4562 w 3 9 1.4562 n 16 5 32.4333 s 16 5 2.4333
i want convert standard decimal format. however, i've never used visual basic before. convention e, n , w, s 1 , -1, respectively. expecting output data list
103.4867934 -3.1504045 16.09234258 -16.08400925
i hope can make visual basic code convert data because have lots of data , can't convert manually.
thanks.
instead of vba can use formula:
=--(index({"+","+","-","-"},match(left(a1,1),{"e","n","w","s"},0))&mid(a1,3,find(" ",mid(a1,3,len(a1))))+mid(a1,find("}}}",substitute(a1," ","}}}",2))+1,2)/60+mid(a1,find("}}}",substitute(a1," ","}}}",3))+1,99)/3600)
Comments
Post a Comment