creating a dynamic range name using vba

T

Tim Marsh

Hi All,

I use dynamic ranges alot, but for the first time i am trying to create a
named range in a workbook using vba (dynamic for columns and rows based on
Column A and Row 1).

the very basic procedure is as follows: -

Sub TimTabMaker()
ActiveWorkbook.Names.Add Name:="timtab",
RefersTo:="=OFFSET(Calendar!$A$1,0,0,COUNTA(Calendar!$A:$A),COUNTA(Calendar!$1:$1)"
End Sub

but when i run it i get a '1004' run-time error, indicating there is a
problem with the formula. I'm guessing there is a very simple reason for
this, but i cannot see it. can you help?!

any help is (as always) appreciated.

cheers guys,

Tim
 
T

Tim Marsh

sorry... i've just realised, i missed the end bracket... DOH!!

"Tim Marsh" <tmarsh-trousers-@-take off my trousers to
reply-blueyonder.co.uk> wrote in message
news:%[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top