View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Brian Murphy Brian Murphy is offline
external usenet poster
 
Posts: 126
Default trouble returning a workbook level Name object

I'm having trouble finding a fail safe syntax to return a Name object that refers to a cell range.

set obj = ActiveWorkbook.Names(somename)

Here "somename" is a book level name that refers to a range of cells.

The statement above returns a range object for the cells.

Well, sometimes, but not all the time.

If the first sheet in the workbook also contains a sheet level name called "somename", then the above statement returns those cells instead.

So, I'm hoping there is some sort of statement syntax that will work regardless of whether the first sheet has a like named sheet level name.

Thanks,

Brian Murphy
Austin, Texas