View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Names of named ranges in active sheet only

Dim nm as Name, rng as Range
for each nm in thisworkbook.Names
set rng = nothing
on Error Resume Next
set rng = nm.ReferstoRange
on Error Goto 0
if not rng is nothing then
if rng.parent.name = Activesheet.name then
' this name is on the same sheet
end if
end if
Next

--
Regards,
Tom Ogilvy



"XP" wrote in message
...
In Excel 2003, is it possible to return only the Names of named ranges in
the
active sheet vs. the entire workbook?

Could someone please post example code on how to do this?

Must the range be named a certain way for the code to detect this info?

Thanks.