Re: Name Of Range Containing Active Cell
ok, I think I see the problem...so I tried
Code
Sub DefineNameandwatermark2007()
Dim i As Long
Dim a, b, c, X
Dim dt As Date
Dim sr As String
dt = DateSerial(2007, 1, 1)
For i = 8 To 24031 Step 66
j = j + 1
' a = Application.WorksheetFunction.Text(dt + j, "ddd")
'b = Application.WorksheetFunction.Text(dt + j, "mmm")
'c = Application.WorksheetFunction.Text(dt + j, "d")
X = Format(dt + j, "yyyymmdd")
'a & b & c
[COLOR="Red"]ActiveWorkbook.Names.Add Name:=X, RefersToR1C1:="=2007!R" & i & "C1:R" & _
i + 65 & "C9"[/COLOR]
Display More
still get the error on last line of code. do I need to use "Alllication.WorksheetFunction.Text" in there too?
Thanks