storing a formula in a name is the same as for a range
Sub addName() Names.add name:="Product", RefersTo:="=OFFSET(Sheet2!$A$2,0,0,COUNTA(Sheet2!$A:$A))" End Sub