Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find Last cell in Range when range is date format | Excel Discussion (Misc queries) | |||
Find a range of values in a range of cells | Excel Worksheet Functions | |||
Find dates in a range; then sum values in that range by a criteria | Excel Discussion (Misc queries) | |||
Find first cell in range and expand range -VBA | Excel Programming | |||
Range.Find returns cell outside of range when range set to single cell | Excel Programming |