
'===================================================
' Q Q295188316
'߲ͣhttp://www.fffsky.com/blog
'䣺ceo@fffsky.com
'===================================================

Option Explicit 'ʽģеб

Private Sub CommandButton1_Click() '㰴ť
Dim j As Integer '                                                                                       Tr
Dim Ai, Bi, Ci, Di, Ei, Fi, Gi, Hi As Double '                                                              U
Dim N, E, D, X, Y, F As Double '                                                                            U
Const Pi = 3.14159265358979 '                                                                            T s
  With Sheets("")
    If Trim(.Cells(3, 2)) = "" Then MsgBox "롰X", vbInformation, "ʾ": Exit Sub '    Tr
    If Trim(.Cells(4, 2)) = "" Then MsgBox "롰Y", vbInformation, "ʾ": Exit Sub '       U
    If Trim(.Cells(5, 2)) = "" Then MsgBox "롰׮K", vbInformation, "ʾ": Exit Sub '       UǷ
    If Trim(.Cells(6, 2)) = "" Then MsgBox "롰㷽λF", vbInformation, "ʾ": Exit Sub '  T s
        N = .Cells(3, 2) '                       Tr
        E = .Cells(4, 2) '                          U
        D = .Cells(5, 2) '                          U֪
        F = .Cells(6, 2) '                       T s
        Gi = Int((.Cells(5, 2) + 10) / 10) * 10 'Tr
        Hi = .Cells(5, 2) + .Cells(7, 2) '          U
        Fi = Abs(F) '                               U
        Ai = Int(Fi) '                              U
        Bi = (Fi - Ai) * 100 '                      U
        Bi = Int(Bi) '                              U
        Ci = (Fi - Ai) * 10000 - 100 * Bi '         UʮתΪʮ
        Di = Bi + Ci / 60 '                         U
        Ei = Ai + Di / 60 '                         U
        If F < 0 Then '                             U
          F = -Ei '                                 U
        Else '                                      U
          F = Ei '                                  U
        End If '                                 T s
        F = F / 180 * Pi
    End With
    j = 9
  Do While Cells(j, 1) <> Empty '                Tr
        X = N + (Cells(j, 1) - D) * Cos(F) '        U
        Y = E + (Cells(j, 1) - D) * Sin(F) '        U
        Cells(j, 2) = Round(X, 3) '                 U
        Cells(j, 3) = Round(Y, 3) '                 U
     j = j + 1 '                                    U
     Loop '                                         U
End Sub '                                        T s

Private Sub CommandButton2_Click() 'ť
  Range("B9:C65536").ClearContents
End Sub
