PC Review


Reply
Thread Tools Rate Thread

creating a dynamic range name using vba

 
 
Tim Marsh
Guest
Posts: n/a
 
      4th Dec 2006
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


 
Reply With Quote
 
 
 
 
Tim Marsh
Guest
Posts: n/a
 
      4th Dec 2006
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:%(E-Mail Removed)...
> 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
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a dynamic range always using the last 10 rows of data yak141 Microsoft Excel Worksheet Functions 3 3rd Oct 2008 01:56 AM
creating a dynamic range based on criteria, within a dynamic range, and passing it to a function rajansood@hotmail.com Microsoft Excel Programming 0 9th Oct 2007 05:22 PM
Creating a Dynamic Named Range Using Sheet Name and Column Header burl_rfc_h Microsoft Excel Programming 8 13th Feb 2006 10:53 PM
Creating Dynamic Range - Missing Last entry =?Utf-8?B?UEM=?= Microsoft Excel Misc 11 22nd Jan 2004 02:16 PM
Creating a name in a macro with a dynamic range Eric G. Microsoft Excel Discussion 1 8th Dec 2003 11:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:43 PM.