I normally set up my dynamic named ranges in the name manager using formulae like
= Offset(A1,0,0,Counta($A:$A),Counta($1:$1))
I now need to be able to set up these ranges using vba code and have come up with the problem that "Offset" in vba has a different meaning from "Offset" in the DefineName window.

I could, I suppose, erase the names after every use and redefine them afresh each time I need them, but this seems cumbersome, the ranges will change from time to time and I would like to keep their dynamic nature.
What is the best way to deal with this in code.
John