Sub GaussJordan(matrix() As Double,rhs() As Double,ans() As Double) Dim As Integer n=Ubound(matrix,1) Redim ans(0):Redim ans(1 To n) Dim As Double b(1 To n,1 To n),r(1 To n) For c As Integer=1 To n 'take copies r(c)=rhs(c) For d As Integer=1 To n b(c,d)=matrix(c,d) Next d Next c #macro pivot(num) For p1 As Integer = num To n - 1 For p2 As Integer = p1 + 1 To n If Abs(b(p1,num))