Please Help with a macro.

T

TwEaKFrEaK

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 For
- CompanyA.xls]" & Performance


I would like to have a name defined in excel that refers to th
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
 
T

Trevor Shuttleworth

TwEaKFrEaK

I think you need RefersTo:=

for example:

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

Regards

Trevor
 
Top