Problem creating a named range
Actually, no, I get a name like ="sheet1!$A$5" but no idea where the "" came
from
"Gary''s Student" wrote:
You are missing an equals sign:
Sub Macro1()
Dim varName As String
Dim varStartCell As String
varName = "alpha"
varStartCell = "$A$5"
ActiveWorkbook.Names.Add Name:=varName, RefersTo:="=Sheet!" & varStartCell
End Sub
--
Gary''s Student - gsnu200796
"headly" wrote:
Code looks like this:
ActiveWorkbook.Names.Add Name:=varName, RefersTo:="Sheet!" & varStartCell
Creates a name, which I cannot use, because it is surrounded by quotation "
" symbols.
Note about Varname: is created after stripping out spaces from user entered
input; varStartCell is an absolute reference like $A$5
TY
|