View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default Find range within a range



You can use the .parent.parent of the range parameter to get a
reference to the workbook containing the range.
From there you should be able to figure out what named ranges exist
with names like TG_*.

Then try creating a range using intersect of the passed parameter and
the named range. If you get a result then that will represent the
cells in common to both the named range and the parameter range.


Tim.


"Tornado" wrote in message
...
Hi,

I am currently calling a method written in a class in VB 6.0. This
method of
the class is called on the form. The method takes a Range (i.e.
Excel range
as a parameter). The method is not allowed to except more than this
as a
parameter.

Now inside the range passed as a parameter there may or may not be
a group
of cells (which themselves are part of a named range (this named
range would
always start with letter TG_ but remaining part of the name is not
known

I want the piece of code to be written inside this method in class
so that
with the given range as parameter, I can scan it and find the cells
which
belong to range starting with name as TG_

I am using VB 6.0 with Excel 2000.

Please do let me know if I can provide further inputs.

Thanks