Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Matrix manipulation in VBA without printing out the worksheet

Morning,

Please can you help me out with the following issue.
I want to apply a formula to a matrix in excel which will produce another
matrix of the same dimension.
I do not want to print this new matrix out onto a worksheet but manipulate
it first in VBA seperately.

I've tried the FormulaArray code :
Worksheets("Sheet1").Range("A1:C5").FormulaArray = fMyFunction(MyRange)
But you need to print the output onto a worksheet for it to work.

How can I keep everything internal?

Thank you!

Michelle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Matrix manipulation in VBA without printing out the worksheet

Hi

Define a Named Range, which contains all data you want to read into array
(it may be also a Dynamic Named Range) - let's it be p.e. MyNamedRange;
In VBA:

....
Dim arrMyArray() As Variant
....

Set arrMyArray = [MyNamedRange]
....


Arvi Laanemets



"michelle439731" wrote in message
...
Morning,

Please can you help me out with the following issue.
I want to apply a formula to a matrix in excel which will produce another
matrix of the same dimension.
I do not want to print this new matrix out onto a worksheet but manipulate
it first in VBA seperately.

I've tried the FormulaArray code :
Worksheets("Sheet1").Range("A1:C5").FormulaArray = fMyFunction(MyRange)
But you need to print the output onto a worksheet for it to work.

How can I keep everything internal?

Thank you!

Michelle



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Matrix manipulation in VBA without printing out the worksheet

in this demo, matrix1 is loaded from a spreadsheet, then that matrix is
inverted and saved into natrix2

Option Explicit

Sub MatrixManipulation()

Dim matrix1 As Variant
Dim matrix2 As Variant
matrix1 = Range("B6:D8")
matrix2 = WorksheetFunction.MInverse(matrix1)
' do something with matrix2
End Sub

you should step (using F8) througj to the end sub then view both matrices in
the watch window to see their contents


"michelle439731" wrote:

Morning,

Please can you help me out with the following issue.
I want to apply a formula to a matrix in excel which will produce another
matrix of the same dimension.
I do not want to print this new matrix out onto a worksheet but manipulate
it first in VBA seperately.

I've tried the FormulaArray code :
Worksheets("Sheet1").Range("A1:C5").FormulaArray = fMyFunction(MyRange)
But you need to print the output onto a worksheet for it to work.

How can I keep everything internal?

Thank you!

Michelle

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
Matrix manipulation in vba code Andrew[_56_] Excel Programming 2 January 14th 09 12:27 AM
Printing to Dot Matrix Jordan Excel Programming 1 April 30th 07 05:14 PM
printing to dot matrix Jordan Excel Discussion (Misc queries) 2 April 30th 07 04:47 PM
Printing labels on a dot matrix via Excel sdrais Excel Discussion (Misc queries) 1 July 20th 06 10:49 PM
Printing labels on a dot matrix printer - what does this code do Laurence Lombard Excel Discussion (Misc queries) 0 June 16th 06 07:18 AM


All times are GMT +1. The time now is 01:27 AM.

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

About Us

"It's about Microsoft Excel"