I regularly use a Defined Range name DATA that I have to create manually. I’m trying to create a macro in Personal.xls to be attached to a button, that will do this for me. The below does not work. It bombs at the last line, and when I look in my test workbook, I do not see the range name as having been created anyway. It shows it defined for a Personal.xls sheet and cell! TYIA.
Sub DefineDATA()
‘
‘ DefineDATA Macro
‘ Range(“A1″).Select
ActiveWorkbook.Names.Add Name:=”DATA”, RefersToR1C1:= _
“=OFFSET(Data!R1C1,0,0,COUNTA(Data!C1),COUNTA(Data!R1))”
Application.Goto Reference:=”DATA”
End Sub
-
Simple utility macro to define range name
- This topic has 3 replies, 3 voices, and was last updated 16 years, 1 month ago.
AuthorViewing 2 reply threadsAuthorViewing 2 reply threads