Ennio-Sr wrote:
* G. Roderick Singleton <[EMAIL PROTECTED]> [080305, 12:43]:Do you want a posting of how to use a named range, or how to use this in a macro? Here is a description that I created of named ranges, or at least a little snippet of text. Now, all of these things assume that I am using the named range in the document in which it is defined. I do not think that I can reference a named range in a completely different document. I mean, I can look at the named ranges and how they are defined, but I do not think that I can use an external named range in a different sheet in part of an equation.
On Tue, 2005-03-08 at 19:29 +0100, Ennio-Sr wrote:
* Andrew Douglas Pitonyak <[EMAIL PROTECTED]> [070305, 22:13]:Should be available by clicking and selecting from the dropdown at the
[...] Thank you, Andrew, for your suggestion, but I cannot figure out how I
could do that: I arrive at the point where the anchor appears on top of
the cell and that's all I can obtain. On the other hand, what type of
equation should it be? Should it refer to the named-range-cell in the
other doc/sheet? Last but not least, (I feel ashamed to confess) the
help suggests to consult OpenOffice.org Math Help, which I was unable to
find ;(
Regards, Ennio.
top right of Help > Contents. Do you see it?
However, having found the Math help and read whatever could be related
to my problem (i.e. how to reference a 'named-range cell' in another
doc/sheet via an equation) I couldn't find a solution. Would Andrew be
so kind to post an example?
Thanks for your attention. Regards,
Ennio.
1.
*Associating a range to a name*
In a Calc document, a range refers to a contiguous group of cells containing at least one cell. You can associate a meaningful name to a range, which allows you to refer to the range using the meaningful name. You can create either a “database range”, which has some database-like functionality, or a “named range”, which does not. A name is usually associated with a range for one of three reasons:
1.
Associating a range with a name enhances readability by
using a meaningful name.2.
If a range is referenced by name in multiple locations, you
can point the name to another location and all references
point to the new location.3.
Ranges associated to a name are shown in the navigator,
which is available using the F5 key. The navigator allows
for quick navigation to the associated ranges.1.
*Named range*
The most common usage of a named range is, as its name implies, to associate a range of cells to a meaningful name. For example, I created a range named “Scores”, and then I used the following equation: “=SUM(Scores)”. To create a named range, select the range to define. Use Insert | Names | Define to open the Define Names dialog. Use the Define Names dialog to add and modify one named range at a time (see Figure 1).
<graphics deleted>
In a macro, a named range is accessed, created, and deleted using the NamedRanges property of a Calc document. Use the methods hasByName(name) and getByName(name) to verify and retrieve a named range. The method getElementNames() returns an array containing the names of all named ranges. The NamedRanges object supports the method addNewByname, which accepts four arguments; the name, content, position, and type. The macro in Listing 1 creates a named range, if it does not exist, that references a range of cells.
-- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm Free Info: http://www.pitonyak.org/oo.php
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
