I use the following code to create dynamic defined named ranges but when I get
to the Define Names Dialog to check the references I notice they are enclosed
in quotation marks and these make them not to work. I attach a sample of my
workbook for you to understand what I mean.
code:
Sub definenames()
'
'
'
Dim d As String
For n = 1 To 9
Cells(1, n).Select
b = Selection.Offset(1, 0).Address
c = Selection.Offset(99, 0).Address
a = Cells(1, n).Value
a = Replace(a, " ", "_")
d = "OFFSET('defined names'!" & b & ",0,0,COUNTA('defined names'!" & b & ":" & c
& ")" & ",1)"
ActiveWorkbook.Names.Add Name:=a, RefersToR1C1:=d
Next
End Sub
Instead of finding the referece in the Define Names Dialog as follows: =
OFFSET('defined names'!" & b & ",0,0,COUNTA('defined names'!" & b & ":" & c &
")" & ",1) it will be enclosed in quotation marks and will be found as:
="OFFSET('defined names'!" & b & ",0,0,COUNTA('defined names'!" & b & ":" & c &
")" & ",1)". These quotation marks must be manually removed before the defined
name will work.
Kindly suggest what to do to the code to make these quotation marks not to
appear in the defined name references. Thank you
There is none like unto the God of Jeshurun who rides through the heavens to
my help and in Majesty through the skies
The eternal God is my dwelling place and underneath me are his everlasting
arms