EXCEL中如何实现角度度分秒的输入以及
MicroSoftFAQConvertingDecimalDegreestoDegrees/Minutes/SecondsFunctionConvert_Degree(Decimal_Deg)AsVariantWithApplication\'SetdegreetoIntegerofArgumentPassedDegrees=Int(Decimal_Deg)\'Setminutesto60timesthenumbertotheright\'ofthedecimalforthevariableDecimal_DegMinutes=(Decimal_Deg-Degrees)*60\'Setse...全部
MicroSoftFAQConvertingDecimalDegreestoDegrees/Minutes/SecondsFunctionConvert_Degree(Decimal_Deg)AsVariantWithApplication\'SetdegreetoIntegerofArgumentPassedDegrees=Int(Decimal_Deg)\'Setminutesto60timesthenumbertotheright\'ofthedecimalforthevariableDecimal_DegMinutes=(Decimal_Deg-Degrees)*60\'Setsecondsto60timesthenumbertotherightofthe\'decimalforthevariableMinuteSeconds=Format(((Minutes-Int(Minutes))*60),"0")\'ReturnstheResultofdegreeconversion\'(forexample,10。
46=10~27\'36")Convert_Degree=""&Degrees&"°"&Int(Minutes)&"\'"_&Seconds+Chr(34)EndWithEndFuncti (A1)ConvertingDegrees/Minutes/SecondstoDecimalDegreesFunctionConvert_Decimal(Degree_DegAsString)AsDouble\'Declarethevariablestobedoubleprecisionfloating-point。
DimdegreesAsDoubleDimminutesAsDoubleDimsecondsAsDouble\'Setdegreetovaluebefore"°" grees=Val(Left(Degree_Deg,InStr(1,Degree_Deg,"°")-1))\'Setminutestothevaluebetweenthe"°"andthe"\'"\'ofthetextstringforthevariableDegree_Degdividedby\'60。
TheValfunctionconvertsthetextstringtoanumber。
minutes=Val(Mid(Degree_Deg,InStr(1,Degree_Deg,"°")+2,_InStr(1,Degree_Deg,"\'")-InStr(1,Degree_Deg,_"°")-2))/60\'Setsecondstothenumbertotherightof"\'"thatis\' conds=Val(Mid(Degree_Deg,InStr(1,Degree_Deg,"\'")+_2,Len(Degree_Deg)-InStr(1,Degree_Deg,"\'")-2))_/3600Convert_Decimal=degrees+minutes+secondsEndFunctionExample:=Convert_Decimal("10°27\'36""")。收起