View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips[_4_] Bob Phillips[_4_] is offline
external usenet poster
 
Posts: 834
Default create defined name using variable file name in reference

Activeworkbook.Names.Add Name:="ACCPath", RefersTo:= "=" &
Activesheet.Range("U2").Value2

---
HTH

Bob Phillips

"hala" wrote in message
...
please help in create defined name
EXAMPLe:
create name : ACCPath ---- Referes to (='E:\Data Folder\[externa work
book.xlsx]sheet1'!$K$8:$K$10000)
this works

I NEED to put (external work book.xlsx) in a cell and refere to it as
variable in the referes to (='E:\Data Folder\[&U2&]sheet1'!$K$8:$K$10000)
where U2 having the file name because it is changing meny times