Help with arrays please

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

I am having problems with arrays, I want to use a table (on a worksheet)
as an indexing/sorting system using a couple of loops (21 rows of 6)
columns. I have tried to workout how to do this from the help files but
to no avail. Could someone please help with the basics I.e. declaring
and naming the array and then the proper wording for retrieving the
information from within the array (if you know what I mean)It will be
text stored in the array
I thought it was something like
dim myarray (21, 6) 'defining the size
myarray (1,1) 'to get the information in column 1 row 1 from the array
But this doesn't work
 
I am selecting a table on a worksheet, making it active and then using
the Selection.array (I did find how to do this in the help files a few
days ago BUT didn't make a note of it, now I cannot find it again.)
I though it was 'Selection.array'

Gary
 
I am trying to use a table on a worksheet, Using the macro to select the
table, selecting it, then using the "selection.array" command (I think
thats the way(saw a help file on how to do it but cannot find it again)

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Dim vArr as Variant
vArr = Selection.Value
for i = 1 to ubound(varr,1)
for j = 1 to ubound(varr,2)
msgbox "vArr(" & i & ", " & j & ")=" & vArr(i,j)
next
next
 
Thankyou, I have given it a go and with a bit of fiddling it works BUT
what are the & signs for please
 
Im trying to put it in by specifying a using the macro to specify a
table on a work sheet, making in active and then the command
selection.Array. (I think that is the commands)
I have got the program to work using the 'offset' command and using the
content of the activated cell as a check reference BUT I have to loop
this 126 times. My thinking is that if I pop this table (which can
change into an array the macro should be a bit faster)
Would it help if I posted the routine?

Gary
 

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

Back
Top