View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Define Names / RefersToRange

What do you mean by "the code fails" - do you get a run-time error?
Does the line execute, but no assignment take place?

Is your name defined as a worksheet-level name?




In article ,
"Andre Achtermeier" wrote:

hi,

i defined a Name "MyName" like

=locACTIVE_Template!$P$49;locACTIVE_Template!$P$86

in VBA i wrote

Dim rng As Range
Set rng = ActiveWorkbook.Names("MyName").RefersToRange

but the code fails and the RefersToRange is nothing.

any idea?