Select a column from a matrix

T

tomfabtastic

Hello,

I have declared a variable:
Dim dataHere(1 to 9, 1 to 3) as double

How could I select the second column from this matrix to use in
further calculations ?

I tried dataHere(All, 2) and dataHere(1 To 9 , 2)but got an error each
time.

Any ideas ?

Tom
 
G

Gary Keramidas

not exactly sure what you're trying to do, but maybe this will give you an idea.

Sub test2()
Dim x As Long
Dim dataHere As Variant
dataHere = Range("A1:C9")
For x = LBound(dataHere) To UBound(dataHere)
Debug.Print dataHere(x, 2)
Next
End Sub
 
T

tomfabtastic

not exactly sure what you're trying to do, but maybe this will give you anidea.

Sub test2()
Dim x As Long
Dim dataHere As Variant
dataHere = Range("A1:C9")
For x = LBound(dataHere) To UBound(dataHere)
      Debug.Print dataHere(x, 2)
Next
End Sub

--

Gary











- Show quoted text -

Hi Gary,

I want to use the result in a MMULT function, so want to take out the
second column and go:

MMULT(dataHere(All, 2), anotherArray)

I'm not sure if this can be done.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top