I have a small/complex problem, but I cannot understand why I'm obtaining this error.
In a vba code I have this:
ws = Sheets("Calendar") c = "Fixed" first = ce.Address end = ce2.Address wb.Names.Add Name:=c, RefersTo:=ws.Name & "!" & first & ":" & end The formula create a named range like this one:
="Calendar!$M$2:$M$4" This named range doesn't show any values, but if I change manually the named range in this:
=Calendar!$M$2:$M$4 It will work.
Where is the issue? Why the formula doesn't work? Which parameter is wrong?
Thanks
ws = Sheets("Calendar")should beSet ws = Sheets("Calendar")andendcannot be a variable name. But the main issue is that the string forRefersTo:=must begin with an equal sign. See msdn.microsoft.com/en-us/library/office/ff834743.aspx.