Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default creating a dynamic range name using vba

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(Calend ar!$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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default creating a dynamic range name using vba

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
...
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(Calend ar!$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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a dynamic range always using the last 10 rows of data yak141 Excel Worksheet Functions 3 October 3rd 08 01:56 AM
creating a dynamic graph violet Excel Programming 1 September 18th 06 02:58 AM
Creating a Dynamic Named Range Using Sheet Name and Column Header burl_rfc_h Excel Programming 8 February 13th 06 10:53 PM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
select dynamic range with dynamic start point Juli Excel Programming 1 August 31st 05 12:05 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"