Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I'm looking for the most efficient way to return the first rangename which includes the current selection. And the current selection can be a single cell. At the moment, I'm using this routine: -Function GetRangename(ByVal SelRng As Range) As String On Error Resume Next Dim nme As name For Each nme In ThisWorkbook.Names If Union(Range(nme), SelRng) = Range(nme) Then GetRangename = nme Exit Function End If Next nme End Function- As far as I know, there's no direct VBA object that returns the first rangename which includes the cell you selected. And if I have to return multiple rangenames, the routine needs to go through all existing rangenames again... Anyone got any more efficient way? Regards, shoba -- shoba ------------------------------------------------------------------------ shoba's Profile: http://www.excelforum.com/member.php...o&userid=24676 View this thread: http://www.excelforum.com/showthread...hreadid=382505 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Testing For a RangeName | Excel Discussion (Misc queries) | |||
Confused with RangeName CellREfs | Excel Discussion (Misc queries) | |||
ActiveWorkbook.Protect password:=range("rangename") does not work | Excel Discussion (Misc queries) | |||
VBA - Syntax filename rangename for vlookup formula | Excel Programming | |||
Concatenate RangeName for INDEX? | Excel Worksheet Functions |