View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default Please Help with a macro.

TwEaKFrEaK

I think you need RefersTo:=

for example:

Companyname = "test"
ActiveWorkbook.Names.Add Name:="CompanyData", RefersTo:=Companyname

Regards

Trevor


"TwEaKFrEaK " wrote in message
...
Here is the code

DataUpdater Macro
'
datayear = ActiveSheet.Range("$M$3")
Quarter = ActiveSheet.Range("$P$3")
QuarterAbev = ActiveSheet.Range("$U$3")
Performance = ActiveSheet.Range("$Y$3")
Companyname = "='S:\Documents\Data\" & datayear & "\Quarter " &
Quarter & ", " & datayear & "\[CRBM " & QuarterAbev & " Data Entry Form
- CompanyA.xls]" & Performance


I would like to have a name defined in excel that refers to the
variable companyname.

THe formula below is what I tried and obviously it didnt work.

ActiveWorkbook.Names.Add Name:="CompanyData", = companyname

Please help me out. Thank you all in advance.


---
Message posted from http://www.ExcelForum.com/