txt ファイルからデータを読み取り、それを整数配列に保存しました。その配列をExcelシートにエクスポートしたいのですが、結果が正しくない理由がわかりません。私を助けてください。
Input #1, n
'Now construct the (n x n) matrix that will hold the problem and read in the problem from the input file
ReDim ProbMatrix(1 To n, 1 To n) As Integer
Dim someNumber As Integer
Dim startPosition As Long
Dim endPosition As Long
Dim temp As String
Do While Not (EOF(1))
    startPosition = Seek(1)  '// capture the current file position'
    Line Input #1, temp      '// read an entire line'
    endPosition = Seek(1)    '// determine the end-of-line file position'
    Seek 1, startPosition    '// jump back to the beginning of the line'
    '// read numbers from the file until the end of the current line'
    For i = 1 To n
        For j = 1 To n
            Do While Not (EOF(1)) And (Seek(1) < endPosition)
                Input #1, someNumber
                ProbMatrix(i, j) = someNumber
                MsgBox ProbMatrix(i, j)
            Loop
        Next j
    Next i        
Loop    
Close #1        
Dim NewProbMatrix() As Integer
Dim act As Action
NewProbMatrix = makeInitialSolution(ProbMatrix, n)
Cells(1, 1) = n
For i = 1 To n
    For j = 1 To n
        Cells(i + 1, j) = ProbMatrix(i, j)
    Next
Next
Application.Save
Workbooks.Close
MsgBox ("Finished")