Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Find range within a range

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
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
Find Last cell in Range when range is date format default105 Excel Discussion (Misc queries) 5 July 7th 09 03:11 PM
Find a range of values in a range of cells Jack Taylor Excel Worksheet Functions 20 November 25th 06 01:26 PM
Find dates in a range; then sum values in that range by a criteria Anders Excel Discussion (Misc queries) 4 October 21st 05 03:41 PM
Find first cell in range and expand range -VBA Caméléon Excel Programming 3 December 4th 04 02:01 AM
Range.Find returns cell outside of range when range set to single cell Frank Jones Excel Programming 12 June 10th 04 04:22 AM


All times are GMT +1. The time now is 05:53 PM.

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

About Us

"It's about Microsoft Excel"