LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default UDF to reference a specific element in an array

I gave a misleading reply having misread the post. I said:
An array of cells in columns is two dimensional, even if it's only in one
column.

but should have said:
An array of cells in rows is two dimensional, even if it's only in one
column

and doesn't directly relate to the question. Instead try

Sub test()
Dim vArr
MsgBox Range("a2:j2")(1, 5), , Range("a2:j2")(1, 5).Address
vArr = Range("a2:j2")
MsgBox vArr(1, 5)
End Sub

Regards,
Peter T

PS sorry my earlier double post, not aware of sending twice.


"Peter T" <peter_t@discussions wrote in message
...
An array of cells in columns is two dimensional, even if it's only in one
column. Try:

MsgBox Range("b5:b14")(5, 1), , Range("b5:b14")(5, 1).Address

As there is only one column you could also use Range("b5:b14")(5) which
returns the 5th cell in the range.

But:
vArr = Range("b5:b14")
msgbox varr(5,1)

Regards,
Peter T


"GH" wrote in message
oups.com...
I am atempting to reference a specific element in a one-diminsional
array. The array is created on a worksheet using the Bloomberg BLP
fuctionality. It essentially enters a number in each of five columns.
Previously, I have been cell referencing the desired item (the 5th)
from the returned array as it is the only item I want. This requires
that the array elements be on the worksheet.

I would rather have a user-defined function that returns just the 5th
item. Something like:

=ReturnedItem("Bloomberg Created Array",5)

Obviously the syntax isn't right but to illustrate.
Any suggestions?

GH







 
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
Counting Array element asingh Excel Worksheet Functions 4 April 12th 10 03:30 PM
Permutations of an array element < to a value Bruce Excel Worksheet Functions 3 January 31st 06 04:00 PM
VBA array - find largest element R. Choate Excel Programming 20 December 15th 04 03:52 AM
Array element Andrea[_8_] Excel Programming 5 December 7th 04 08:24 PM
deleting array element michael Excel Programming 0 December 18th 03 08:55 PM


All times are GMT +1. The time now is 12:19 PM.

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

About Us

"It's about Microsoft Excel"