回覆列表
  • 1 # 使用者7169188564904

    你的end if放錯地方了和next i 換個位置就行了。

    程式碼如下

    Sub QR(rng As Range)

    Dim rng1 As Range, n As Integer

    Dim q As Integer, p As Integer

    Dim i As Integer

    householder rng

    n = rng.Rows.Count

    With rng

    Do

    q = 1

    p = 1

    For i = n - 1 To 1 Step -1

    If Abs(.Cells(i + 1, i).Value)

    .Cells(i + 1, i).Value = 0

    .Cells(i, i + 1).Value = 0

    If q > 1 And p = 1 Then

    p = i + 1

    ElseIf q = 1 Then

    q = i + 1

    End If

    End If

    Next i

    If q > 1 Then wilkinsonQR Range(.Cells(p, p), .Cells(q, q)) "呼叫WilkinsonQR步

    Loop Until q = 1

    End With

    End Sub

  • 中秋節和大豐收的關聯?
  • 班得瑞的唯美純情音樂集合?