Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Global Names Issue

Hi There,

I would like to make some Sub-totals (DataSubtotals) and replace the
resulting formulas
like eg: =SUBTOTAL(9;G2:G29)
with formula: =SUBTOTAL(9;G2:NextUp)
to make sure that when inserting a new row I sum properly!

As by Charly Kid: http://www.exceluser.com/solutions/errors_sums.htm

Where NextUp is a Defined Name created (with G29 being the active cell)
as: !G28
At first it seems a practical technique!

There is though a serious drawback to the use of this kind of Usage:
Discussion on:
http://www.dicks-blog.com/archives/2...defined-names/

Jan-Karel Pieterse:
Quote:
"If you use names like that, as long as Excel itself is firing the
recalculation of the worksheet, all is well.
BUT.
As soon as VBA fires a recalc (e.g. Application.Calculate)
Any cell that uses this global sheet-independent name will get the
value of cell A1 ON THE ACTIVE SHEET!
Unquote (Refering to the name: =!$A$1)

Stephen Bullen:
Quote:
"DONT DO THAT!!
Its even worse than Jan Karel suggests. If, for example, you have
calculation set to automatic, you can trigger a recalc in VBA by
setting a cells value in any worksheet. If you do, the global
name will refer to the worksheet in which the recalc was triggered.
'
Unquote

These Excel-lencies strongly disapprove the usage of this kind of
Global names!
Though suggest the following:

JKP:
"Better to use =INDIRECT(A1), which has the desired effect too,
without the VBA recalc bug.
Only drawback is that the reference is fixed, ..
''
Charles Williams:
Quote:
"You can create global relative names using INDIRECT with R1C1 mode
reference, but personally I would prefer not to use such a
construction!
=INDIRECT(R[-1]C1,False)
"
Unqoute

IMO, to by-pass the problem of in-correct calculation when forcing a
VBA-recalc my NextUp name should be as described by Charles! Though it
seems he is not fond of his own "construction".

Why?
What are the drawbacks on this name?


Thanks for your insights!
Sige

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
Defined Names issue Nick Excel Discussion (Misc queries) 0 July 23rd 08 08:35 PM
global changes Eclaires Excel Worksheet Functions 2 March 17th 08 01:03 PM
Convert Local Names to Global Names Ed Excel Worksheet Functions 1 November 30th 05 05:23 PM
Names.Add - Range Syntax Issue Arturo Excel Programming 4 April 22nd 05 04:04 PM
Change names of files in a folder to match names in Excel Column saybut Excel Programming 4 February 9th 04 06:26 PM


All times are GMT +1. The time now is 06:47 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"