[Solved] Confusion RE: getCellRangeByName

Discuss the spreadsheet application
Post Reply
Fizzle_Fuze
Posts: 2
Joined: Sat Jul 10, 2021 6:03 pm

[Solved] Confusion RE: getCellRangeByName

Post by Fizzle_Fuze »

Greetings!

I am struggling to use the function getCellRangeByName correctly, due to the way the documentation is written.

The first problem I figured out is that Calc requires a semi-colon as a parameter delimiter, yet the documentation usually states to use a comma. This resulted in error 508, which the help documentation incorrectly states is a missing bracket. I tried taking the delimiter out, as the documentation for this specific function does not list one, or perhaps lists white space as one, this resulted in error 509.

Now I have error `#NAME`, which is equally confusing because there is no name type of parameter, despite the name of the function containing the phrase "ByName".

Clearly I cannot understand the documentation as written, so I appreciate any clarity you can provide.

Here is the documentation I am referring to: https://www.openoffice.org/api/docs/com ... angeByName
Here is the most basic formula I am trying to get to work:

Code: Select all

=getcellrangebyname("A1"; "A1:C5")
Thanks in advance! :)
Last edited by Hagar Delest on Sat Jul 31, 2021 10:05 am, edited 2 times in total.
Reason: Tagged ✓ [Solved]
<3 FF
OpenOffice 4.1.10 on Fedora 34 and Windows 10
FJCC
Moderator
Posts: 9274
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Confusion RE: getCellRangeByName

Post by FJCC »

getCellrangeByName is a function in the Application Programming Interface, i.e. it is used within macros, and you cannot use it in a cell in a spreadsheet. Calc functions in cells use the semicolon as the argument separator, functions in the API use a comma as the separator.

I am not sure what you are trying to do with the function. Can you please explain your goal?
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Confusion RE: getCellRangeByName

Post by Villeroy »

Calc works like any other spreadsheet program. The documentation you refer to has nothing to do with Calc as a user application. It refers to the application programming interface.
----------
A reference to a cell range works like this when you need to sum up its numbers:
=SUM(A1:B10)

For all the rest you may use any old Excel book from the 90ies (with minor differences).
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Fizzle_Fuze
Posts: 2
Joined: Sat Jul 10, 2021 6:03 pm

Re: Confusion RE: getCellRangeByName

Post by Fizzle_Fuze »

FJCC wrote:getCellrangeByName is a function in the Application Programming Interface, i.e. it is used within macros, and you cannot use it in a cell in a spreadsheet. Calc functions in cells use the semicolon as the argument separator, functions in the API use a comma as the separator.

I am not sure what you are trying to do with the function. Can you please explain your goal?

Thank you very much for your reply, it is quite informative.

My goal is to use the value of a cell, which is referenced from within a range, in a formula.

E.g: I wish to use the number in the second row of the third column within the range named "TestRange" in a formula such as `x+1`.
<3 FF
OpenOffice 4.1.10 on Fedora 34 and Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Confusion RE: getCellRangeByName

Post by Villeroy »

Use the INDEX function.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply