Excel电子表格中怎么打 度分秒(°′″)就是角度
用宏解决,先整体判断数值的区间,0-1,1-10,10-100,决定取几位,作为度,接着用整体值减去整个值的前三位【也就是取整数】,然后判断差值的区间,0-1,1-10,10-60,作为分,最后是秒,同样的方法,写下来代码很多,呵呵,本来想粘贴上来给你参考,无奈字数有限,就贴一部分,另外提醒下,255.32124是不是应该是 255° 分要*60,然后秒*60【看你情况哦】呢,曾经我一个程序的一部分就有弧度转角度。
Sub HDtoJD()
Dim i As Integer
i = i + 1
For i = 3 To 36
Dim pi
pi = 4 * Atn(1)
Dim Degree As String
Degree = Sheets(1).Cells(i, 8).Value
Dim Minute1, Minute2, Minute3 As String
Dim Second1, Second2 As String
Dim Second10, Second12 As String
Dim Second100, Second120 As String
Dim n As String
n = Sheets(1).Cells(2, 8).Value
Minute1 = (Val(Degree) - Val(Left(Degree, 1))) * 60
Minute2 = (Val(Degree) - Val(Left(Degree, 2))) * 60
Minute3 = (Val(Degree) - Val(Left(Degree, 3))) * 60
Second1 = (Val((Val(Degree) - Val(Left(Degree, 1))) * 60) - Val(Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 1))) * 60
Second2 = (Val((Val(Degree) - Val(Left(Degree, 1))) * 60) - Val(Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 2))) * 60
Second10 = (Val((Val(Degree) - Val(Left(Degree, 2))) * 60) - Val(Left((Val(Degree) - Val(Left(Degree, 2))) * 60, 1))) * 60
Second12 = (Val((Val(Degree) - Val(Left(Degree, 2))) * 60) - Val(Left((Val(Degree) - Val(Left(Degree, 2))) * 60, 2))) * 60
Second100 = (Val((Val(Degree) - Val(Left(Degree, 3))) * 60) - Val(Left((Val(Degree) - Val(Left(Degree, 3))) * 60, 1))) * 60
Second120 = (Val((Val(Degree) - Val(Left(Degree, 3))) * 60) - Val(Left((Val(Degree) - Val(Left(Degree, 3))) * 60, 2))) * 60
If Sheets(1).Cells(i, 8).Value "" Then
'if Degree = ""
'///////////////////////////////////////////////////////////////////////////////////////////////////////0-1 Degree Starting
If Degree >= 0 And Degree < 1 Then
'0-1 Degree Start
If Minute1 = 0 Then
'0-1 Minute Start
If Second1 = 0 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & _
" 0" & " " & _
" 0" & _
Left(Second1, 3)
End If
If Second1 = 0.01 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & _
" 0" & " " & _
" 0" & _
Left(Second1, 3)
End If
If Second1 = 0.1 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & _
" 0" & " " & _
" 0" & _
Left(Second1, 3)
End If
If Second1 = 1 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & _
" 0" & " " & _
" " & Left(Second1, 4)
End If
If Second1 = 10 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & _
" 0" & " " & _
Left(Second1, 5)
End If
End If
'0-1 Minute Filished
If Minute1 = 1 Then
'1-10 Minute Start
If Second1 = 0 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 1) & " " & _
" 0" & _
Left(Second1, 3)
End If
If Second1 = 0.01 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 1) & " " & _
" 0" & _
Left(Second1, 3)
End If
If Second1 = 0.1 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 1) & " " & _
" 0" & _
Left(Second1, 3)
End If
If Second1 = 1 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 1) & " " & " " & _
Left(Second1, 4)
End If
If Second1 = 10 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 1) & " " & _
Left(Second1, 5)
End If
End If
'1-10 Minute Filished
If Minute1 = 10 Then
'10-60 Minute Start
If Second2 = 0 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 2) & " " & _
" 0" & _
Left(Second2, 3)
End If
If Second2 = 0.01 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 2) & " " & _
" 0" & _
Left(Second2, 3)
End If
If Second2 = 0.1 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 2) & " " & _
" 0" & _
Left(Second2, 3)
End If
If Second2 = 1 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 2) & " " & " " & _
Left(Second2, 4)
End If
If Second2 = 10 Then
Sheets(1).Cells(i, 6).Value = " 0" & " " & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 2) & " " & _
Left(Second2, 5)
End If
End If
'10-60Minute filished
End If
'0-1 Degree Filished
'///////////////////////////////////////////////////////////////////////////////////////////////////////0-1 Degree Filished
'///////////////////////////////////////////////////////////////////////////////////////////////////////1-10 Degree Starting
If Degree >= 1 And Degree < 10 Then
'1-10 Degree Start
If Minute1 = 0 Then
'0-1 Minute Start
'///////处理由于科学计数产生的负数Started
If Minute1 < 0.01667 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & _
" 0" & " " & _
" 0" & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 3600, 3)
End If
If Minute1 >= 0.01667 And Minute1 < 0.1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & _
" 0" & " " & _
" " & Left((Val(Degree) - Val(Left(Degree, 1))) * 3600, 3)
End If
'///////处理由于科学计数产生的负数Filished
If Second1 = 0 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & _
" 0" & " " & _
" 0" & _
Left(Second1, 3)
End If
If Second1 = 0.1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & _
" 0" & " " & _
" 0" & _
Left(Second1, 3)
End If
If Second1 = 1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & _
" 0" & " " & _
" " & Left(Second1, 4)
End If
If Second1 = 10 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & _
" 0" & " " & _
Left(Second1, 5)
End If
End If
'0-1 Minute Filished
If Minute1 = 1 Then
'1-10 Minute Start
If Second1 = 0 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 1) & " " & _
" 0" & _
Left(Second1, 3)
End If
If Second1 = 0.01 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 1) & " " & _
" 0" & _
Left(Second1, 3)
End If
If Second1 = 0.1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 1) & " " & _
" 0" & _
Left(Second1, 3)
End If
If Second1 = 1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 1) & " " & _
" " & Left(Second1, 4)
End If
If Second1 = 10 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 1) & " " & _
Left(Second1, 5)
End If
End If
'1-10 Minute Filished
If Minute2 = 10 Then
'10-60 Minute Start
If Second2 = 0 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 2) & " " & _
" 0" & _
Left(Second2, 3)
End If
If Second2 = 0.01 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 2) & " " & _
" 0" & _
Left(Second2, 3)
End If
If Second2 = 0.1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 2) & " " & _
" 0" & _
Left(Second2, 3)
End If
If Second2 = 1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 2) & " " & _
" " & Left(Second2, 4)
End If
If Second2 = 10 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 1) & " " & _
Left((Val(Degree) - Val(Left(Degree, 1))) * 60, 2) & " " & _
Left(Second2, 5)
End If
End If
'10-60 Minute Filished
End If
'1 -10 Degree Filished
'//////////////////////////////////////////////////////////////////////////////////////1-10 Degree Filished
'/////////////////////////////////////////////////////////////////////////////////////10-100 Degree Starting
If Degree >= 10 And Degree < 100 Then
'10-100 Degree Start
If Minute2 = 0 Then
'0-1 Minute Start
'///////处理由于科学计数产生的负数Started
If Minute2 < 0.01667 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & _
" 0" & " " & _
" 0" & _
Left((Val(Degree) - Val(Left(Degree, 2))) * 3600, 3)
End If
If Minute2 >= 0.01667 And Minute2 < 0.1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & _
" 0" & " " & _
" " & Left((Val(Degree) - Val(Left(Degree, 2))) * 3600, 3)
End If
'///////处理由于科学计数产生的负数Filished
If Second10 = 0 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & _
" 0" & " " & _
" 0" & _
Left(Second10, 3)
End If
If Second10 = 0.1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & _
" 0" & " " & _
" 0" & _
Left(Second100, 3)
End If
If Second10 = 1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & _
" 0" & " " & _
" " & Left(Second10, 4)
End If
If Second12 = 10 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & _
" 0" & " " & _
Left(Second12, 5)
End If
End If
'0-1 Minute Filished
If Minute2 = 1 Then
'1-10 Minute Start
If Second10 = 0 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 2))) * 60, 1) & " " & _
" 0" & _
Left(Second10, 3)
End If
If Second10 = 0.01 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 2))) * 60, 1) & " " & _
" 0" & _
Left(Second10, 3)
End If
If Second10 = 0.1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 2))) * 60, 1) & " " & _
" 0" & _
Left(Second10, 3)
End If
If Second10 = 1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 2))) * 60, 1) & " " & _
" " & Left(Second10, 4)
End If
If Second12 = 10 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & "0" & _
Left((Val(Degree) - Val(Left(Degree, 2))) * 60, 1) & " " & _
Left(Second12, 5)
End If
End If
'1-10 Minute Filished
If Minute3 = 10 Then
'10-60 Minute Start
If Second12 = 0 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & _
Left((Val(Degree) - Val(Left(Degree, 2))) * 60, 2) & " " & _
" 0" & _
Left(Second12, 3)
End If
If Second12 = 0.01 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & _
Left((Val(Degree) - Val(Left(Degree, 2))) * 60, 2) & " " & _
" 0" & _
Left(Second12, 3)
End If
If Second12 = 0.1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & _
Left((Val(Degree) - Val(Left(Degree, 2))) * 60, 2) & " " & _
" 0" & _
Left(Second12, 3)
End If
If Second12 = 1 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & _
Left((Val(Degree) - Val(Left(Degree, 2))) * 60, 2) & " " & _
" " & Left(Second12, 4)
End If
If Second12 = 10 Then
Sheets(1).Cells(i, 6).Value = " " & Left(Degree, 2) & " " & _
Left((Val(Degree) - Val(Left(Degree, 2))) * 60, 2) & " " & _
Left(Second12, 5)
End If
End If
'10-60 Minute Filished
End If
'10-100 Degree Flished
'/////////////////////////////////////////////////////////////////////////////////////10-100 DegreeFilished
'/////////////////////////////////////////////////////////////////////////////////////100-360 Degree Starting
以上只是部分代码,字数限制啊,后面的你可以参照前面的了。
弱弱的问一句,不会你也是搞测量的吧?哈哈
1、首先在电脑桌面上打开EXCEL表格。
2、接着选中单元格,设置自定义单元格格式。
3、在弹出的类型对话框中选择#°00”00.0”度分秒的格式。
4、单击确定退出,然后在单元格里输入1202345.0,这种形式的,把鼠标拉到其他位置,退出就能将角度转化成度分秒的格式了。
一、首先,先打开Excel程序,选中空白单元格,用来输入度分秒格式数据。
二、然后右键点击这个单元格,点击“设置单元格格式”。
三、然后在弹出的对话框中左侧找到“自定义”,点击选中。
四、然后在右侧的“类型”输入“ [hh]"°"mm"′"ss"″" ”,然后【确定】。
五、然后在单元格内输入数据。
六、Excel表格度分秒设置完成
Excel电子表格中打度分秒(°′″)符号的方法(Excel 2010):
1、打开Excel电子表格的“插入”菜单栏,点击【符号】。
2、在“符号"里找到,点击【插入】即可。
°:字符代码 - 004F;
′ :字符代码 - 02CA;
″ :字符代码 - 0022。
效果:
Excel电子表格中的度分秒可以在/插入/符号/找到,如常用的快捷方法,按ALT键不松,在小键盘的数字键中输入41443, 度就可以出来了。同理即 度分秒对应按41443 ,41444 ,41445 就行了,我回答了5次了为何通不过呀