I am adding (or overwriting the existing) name using VBA. Var str is String.
This one works:
The next one not.
Why? I always hated R1C1 way...
This one works:
Code:
str = "=IFERROR(INDEX(Tickets!R5C2:R1024C13,MATCH(!RC4,Tickets!R5C4:R1024C4,0),!R3C2),0)"
ActiveWorkbook.Names.Add Name:="DGrab", RefersToR1C1:=str
ActiveWorkbook.Names("DGrab").Comment = "Nice one!"
Code:
str = "=IFERROR(INDEX(Tickets!$B$5:$M$2048,MATCH(!$D5,Tickets!$D$5:$D$2048,0),!$B$3),0)"
ActiveWorkbook.Names.Add Name:="DGrab", RefersTo:=str
ActiveWorkbook.Names("DGrab").Comment = "Nice one!"