Thread: MMULT in VBA
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Jackson Jim Jackson is offline
external usenet poster
 
Posts: 324
Default MMULT in VBA

Much better.

Thanks.
--
Best wishes,

Jim


"Ron Rosenfeld" wrote:

On Sun, 30 Jul 2006 08:27:02 -0700, Jim Jackson
wrote:

If anyone else comes across this situation, here is the code I finally got to
work:

Sub mmult()

Set r1 = ActiveCell.Offset(0, -8)
Set r8 = ActiveCell.Offset(0, -1)

Set c1 = ActiveCell.Offset(-8, -9)
Set c8 = ActiveCell.Offset(-1, -9)


ActiveCell = "=MMult(" & r1.Address & ":" & r8.Address & "," & c1.Address &
":" & c8.Address & ")"
End Sub


Jim
--
Best wishes,

Jim


Here's another solution:

----------------------------------------
Sub mmult()

Set r1 = ActiveCell.Offset(0, -8)
Set r8 = ActiveCell.Offset(0, -1)

Set c1 = ActiveCell.Offset(-8, -9)
Set c8 = ActiveCell.Offset(-1, -9)

Set Range1 = Range(r1, r8)
Set Range2 = Range(c1, c8)

ActiveCell.Value = Application.WorksheetFunction.mmult(Range1, Range2)

End Sub
------------------------------------------


--ron