Загрузка данных


Sub FastMatrix()
    Dim m(1 To 5, 1 To 5) As Double, c(1 To 5) As Double
    Dim f As Integer, i As Integer, j As Integer, g As Double, s As String
    
    f = FreeFile
    Open Application.GetOpenFilename For Input As #f
    For i = 1 To 5
        For j = 1 To 5
            Input #f, m(i, j)
            Cells(i, j).Value = m(i, j)
        Next j
    Next i
    Close #f
    
    g = -1E+308
    For j = 1 To 5
        c(j) = m(1, j)
        For i = 2 To 5
            If m(i, j) > c(j) Then c(j) = m(i, j)
        Next i
        If c(j) > g Then g = c(j)
        s = s & "Col " & j & ": " & c(j) & vbCrLf
    Next j
    
    MsgBox s & "Global Max: " & g
End Sub