Returning Cell Refrences/range Refrences

  • Thread starter Thread starter ksnapp
  • Start date Start date
K

ksnapp

I need a sub that searches a column and finds the first cell that say
"PORK", then it has to search fruther down and find the second instanc
of "PORK" and give some form of cell refrence/ range reference that
can plug into a furmula. (I can write that part, I hope). Then I nee
it to do the same thing for each successive instance of "PORK." Eac
time it says pork im gonna run different formulas in 3 or 4 cells t
the right using the range that the sub returns.

Is this possible
 
Hi
you may explain this with some more detail :-)
- where do you want this result to be stored (as this could return
multiple values - on for each 'Pork')
- you may tell us in what kind of formula you want to use the results
- even better: Try Explaining what you're trying to achieve with some
sample data (plain text, no attachments please)
 
If the functions in the freely downloadable file at
http://home.pacbell.net/beban are available to your workbook, and
assuming your data is in a range named "dataRange", the following, array
entered into a vertical range sufficiently large to accommodate the
occurrences of "PORK", will return a vertical column of the cell
addresses of all occurrences:

=ArrayMatch("PORK",dataRange,"A")

Alan Beban
 
Pork
Chicken
Beef
Pork
Lamb
Pork

THis is an analgoy of the was my data is ordered. The functions ar
udf I wrote with the help of this board. The udf(s) do there wor
based on the stuff in this column. THere are numbers on either sid
that they crunch. What Im hopin the sub will do will give the th
rage between "Pork" so I can put it in the range argument of the ud
(range is the only argument in the udf) I think i know how to call an
insert the udfs in the right cells, but i don't know how to automat
the range finding.

does that help at all, I can't be to specific due to work polic
 
Hi
and which range do you want to get?
A1:A4
or
A1:A6
or A2:A3

not quite sure as you have 3 'Pork' instances
 
Back
Top