Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Dynamic named ranges not saving

Hi All,

I have a spreadsheet with some 40 named ranges that l want to be dynamic to
use in UserForms and have therefore used the following type of formula to
define the named range

MyNamedRange=offset(Sheet1!$A$1,0,0,COUNTA(Sheet1! $A$1:$A$50),2)

All works fine until l save the workbook. When l re-open the workbook and
look at the defined name it reverts to something like

MyNamedRange = Sheet1!$A$1:$A$11 where A11 would be the last cell
with anything in it

Does anybody know what is wrong. I need to have the named ranges dynamic for
any session that the workbook is used.

I am using Excel 2003 but it needs to work in Excel 97

TIA

Regards

Michael Beckinsale


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Dynamic named ranges not saving

Hi All,

Just found the problem. There was a 'Workbook_Open' event that defined the
range on opening therefore overwriting the formula derived range.

Sorry if anybody has spent any time on this.

Regards

Michael Beckinsale



"Michael Beckinsale" wrote in message
...
Hi All,

I have a spreadsheet with some 40 named ranges that l want to be dynamic
to use in UserForms and have therefore used the following type of formula
to define the named range

MyNamedRange=offset(Sheet1!$A$1,0,0,COUNTA(Sheet1! $A$1:$A$50),2)

All works fine until l save the workbook. When l re-open the workbook and
look at the defined name it reverts to something like

MyNamedRange = Sheet1!$A$1:$A$11 where A11 would be the last
cell with anything in it

Does anybody know what is wrong. I need to have the named ranges dynamic
for any session that the workbook is used.

I am using Excel 2003 but it needs to work in Excel 97

TIA

Regards

Michael Beckinsale



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Dynamic named ranges not saving

I couldn't reproduce it. I suggest somewhere in your code you are redefining
the named range.

set rng = Range("MyNamedRange")

..
..
..

rng.Name = "MyNamedRange"

as an example

--
Regards,
Tom Ogilvy


"Michael Beckinsale" wrote:

Hi All,

I have a spreadsheet with some 40 named ranges that l want to be dynamic to
use in UserForms and have therefore used the following type of formula to
define the named range

MyNamedRange=offset(Sheet1!$A$1,0,0,COUNTA(Sheet1! $A$1:$A$50),2)

All works fine until l save the workbook. When l re-open the workbook and
look at the defined name it reverts to something like

MyNamedRange = Sheet1!$A$1:$A$11 where A11 would be the last cell
with anything in it

Does anybody know what is wrong. I need to have the named ranges dynamic for
any session that the workbook is used.

I am using Excel 2003 but it needs to work in Excel 97

TIA

Regards

Michael Beckinsale



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
Dynamic Named Ranges - is this possible? Code Numpty Excel Worksheet Functions 2 March 10th 10 04:01 PM
Dynamic Named Ranges CellShocked Excel Worksheet Functions 3 October 31st 09 05:30 AM
Dynamic Named Ranges [email protected] Charts and Charting in Excel 0 March 9th 06 03:09 PM
Dynamic Named Ranges clane Excel Discussion (Misc queries) 5 October 13th 05 03:26 PM
dynamic named ranges peter Excel Programming 1 February 10th 05 12:33 AM


All times are GMT +1. The time now is 08:25 AM.

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"