Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Operating Matrix in vba

when i wanna get the solution of multiplying two matrix, i can use a
worksheet function.
worksheetfunction.mmult(MarixA, MatrixB)

but how can i get the solution of multiplying a number and a matrix without
using a user-defined function?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 200
Default Operating Matrix in vba

You can insert the following code:

newMatrix = MatrixA
For i = LBound(NewMatrix) To UBound(NewMatrix)
For j = LBound(NewMatrix, 2) To UBound(NewMatrix, 2)
newMatrix(i, j) = 3 * NewMatrix(i, j)
Next
Next

or you can put essentially identical code in a Function

Function DoNotCallMeUDF(iArray)
newMatrix = iArray
For i = LBound(newMatrix) To UBound(newMatrix)
For j = LBound(newMatrix, 2) To UBound(newMatrix, 2)
newMatrix(i, j) = 3 * newMatrix(i, j)
Next
Next
DoNotCallMeUDF = newMatrix
End Function

and code

newMatrix = DoNotCallMeUDF(MatrixA)

Why the prohibition on the latter???

Alan Beban

infshare wrote:
when i wanna get the solution of multiplying two matrix, i can use a
worksheet function.
worksheetfunction.mmult(MarixA, MatrixB)

but how can i get the solution of multiplying a number and a matrix without
using a user-defined function?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Highlighting Operating Hours Rebecca R Charts and Charting in Excel 3 August 17th 07 07:23 PM
operating notepad from VBA pm[_2_] Excel Programming 4 February 4th 06 10:12 AM
Find out Operating System Mohan[_2_] Excel Programming 5 January 16th 04 08:36 PM
Operating system Don Guillett[_4_] Excel Programming 0 September 10th 03 04:43 PM
Operating system Stephan Kassanke Excel Programming 0 September 10th 03 04:42 PM


All times are GMT +1. The time now is 01:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"