Bonsoir,
je bloque sur une erreur depuis quelques minutes, et franchement je sèche..
Je veux faire le produit de deux matrices voici le module:
Code:Global B(10, 10) As Double Global C(10, 10) As Double Sub produit(A, B, C) nla = A(1, 0) ncb = B(0, 1) nca = A(0, 1) For i = 1 To nla For j = 1 To ncb s = 0 For k = 1 To nca s = s + A(i, k) * B(k, j) C(i, j) = s Next Next Next C(1, 0) = nla C(0, 1) = ncb End Sub Sub lecture2(A) nl = UserForm1.TextBox3.Text nc = UserForm1.TextBox4.Text For i = 1 To nl For j = 1 To nc A(i, j) = UserForm1.Spreadsheet2.Cells(i, j) << erreur ici d'après la machine............ Next Next A(1, 0) = nl A(0, 1) = nc End Sub Sub lecture1(A) nl = UserForm1.TextBox1.Text nc = UserForm1.TextBox2.Text For i = 1 To nl For j = 1 To nc A(i, j) = UserForm1.Spreadsheet1.Cells(i, j) Next Next A(1, 0) = nl A(0, 1) = nc End Sub Sub affiche3(A) efface3 nl = A(1, 0) nc = A(0, 1) For i = 1 To nl For j = 1 To nc UserForm1.Spreadsheet3.Cells(i, j) = A(i, j) Next Next UserForm1.TextBox5.Text = nl UserForm1.TextBox6.Text = nc End Sub et la commande Private Sub CommandButton8_Click() lecture1 A lecture2 B produit (A), (B), C affiche3 (C) End Sub
si quelqu'un pouvait m'aider...
merci d'avance
-----