ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find Method Used within Values in an Array of Ranges (https://www.excelbanter.com/excel-programming/388133-find-method-used-within-values-array-ranges.html)

[email protected]

Find Method Used within Values in an Array of Ranges
 
Hello,

I am trying to search through the elements in an array (each of which
is a range object).

I would like to use something like

set c=worksheets(1).myarray.find(1,lookin:=xlvalues),

but this doesn't work.

Any tips?

Regards,

Calvin


Tom Ogilvy

Find Method Used within Values in an Array of Ranges
 
if each element is a range object, then thay each are on a specific sheet and
need no qualification.

however, you can't just use myarray.find with an array of range objects.

if all the references are on a single sheet you might try

set r = myArray(lbound(myArray))
for i = lbound(myArray)+1 to Ubound(myArray)
set r = Union(r,myarray(i))
Next
set c = r.find(1,lookin:=xlvalues),

else you will have to search each element of the array in a loop.

--
Regards,
Tom Ogilvy


" wrote:

Hello,

I am trying to search through the elements in an array (each of which
is a range object).

I would like to use something like

set c=worksheets(1).myarray.find(1,lookin:=xlvalues),

but this doesn't work.

Any tips?

Regards,

Calvin




All times are GMT +1. The time now is 11:31 AM.

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