ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Attn Alan Bedan re arrays (https://www.excelbanter.com/excel-programming/302616-attn-alan-bedan-re-arrays.html)

Gary[_18_]

Attn Alan Bedan re arrays
 
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\0\0\0\0\0

Tom Ogilvy

Attn Alan Bedan re arrays
 
see your original post for an example.

--
Regards,
Tom Ogilvy

"Gary" wrote in message
d.com...
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




Tom Ogilvy

Attn Alan Bedan re arrays
 
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

--
Regards,
Tom Ogilvy
"Gary" wrote in message
d.com...
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




Gary[_18_]

Attn Alan Bedan re arrays
 
It pointed me in the right direction, At least of got a starting point
thankyou (some of the bits in there I didnt understand (Why the &
signs?)
and Does it need to be called vArr could I call it somethin like Groups?

Thankyou for your help so far

Gary


In article m,
says...
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\0\0\0\0\0


Tom Ogilvy

Attn Alan Bedan re arrays
 
You can call it anything you want as long as you dim it as variant as shown.

The ampersands build a string to help you see what is contained in each
element of the array. It has nothing to do with functionality. It is an
example. All you need is

Dim Groups as Variant
Groups = Selection.Value

Assuming Selection is a single area range.

--
Regards,
Tom Ogilvy


"Gary" wrote in message
...
It pointed me in the right direction, At least of got a starting point
thankyou (some of the bits in there I didnt understand (Why the &
signs?)
and Does it need to be called vArr could I call it somethin like Groups?

Thankyou for your help so far

Gary


In article m,
says...
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




Alan Beban[_2_]

Attn Alan Bedan re arrays
 
Gary wrote:
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


You didn't articulate what it is you're trying to do. Did Tom Ogilvy's
second post in this thread solve your problem?

Alan Beban

Alan Beban[_2_]

Attn Alan Bedan re arrays
 
Tom Ogilvy wrote:

You can call it anything you want as long as you dim it as variant as shown.

The ampersands build a string to help you see what is contained in each
element of the array. It has nothing to do with functionality. It is an
example. All you need is

Dim Groups as Variant
Groups = Selection.Value

Assuming Selection is a single area range.

And if Selection is a multi-area range, if the functions in the freely
downloadable file at http://home.pacbell.net/beban are available to your
workbook and you are using Excel 2000 or later

Dim Groups()
Assign Selection, Groups

will load the value from the selected range into a one-dimensional
array, Groups.

Alan Beban


All times are GMT +1. The time now is 04:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com