<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Darloth</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Darloth"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Darloth"/>
	<updated>2026-11-25T09:04:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Custom_functions&amp;diff=56441</id>
		<title>Talk:Custom functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Custom_functions&amp;diff=56441"/>
		<updated>2007-12-06T10:34:27Z</updated>

		<summary type="html">&lt;p&gt;Darloth: a fool I tell you :)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Where to put code ==&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s great to see some explanation on creating custom functions. I have not seen the functions I write show up in the function wizard in the &amp;#039;&amp;#039;&amp;#039;Function&amp;#039;&amp;#039;&amp;#039; list box of the &amp;#039;&amp;#039;&amp;#039;Functions&amp;#039;&amp;#039;&amp;#039; tab. This made me believe at first that I was not putting my custom function code in the right place or that I needed to change a setting.&lt;br /&gt;
&lt;br /&gt;
Could someone explain where exactly the code should be placed? [[User:Jebix|Jebix]] 04:04, 6 July 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
: Sorry I missed it. A good explanation about where to write code is already in the article [[Extensions development basic]] page. Maybe &amp;#039;&amp;#039;Extensions development basic&amp;#039;&amp;#039; is not the best name. I think &amp;#039;&amp;#039;OpenOffice.org Basic&amp;#039;&amp;#039; might be a better name. The title &amp;#039;&amp;#039;Basic&amp;#039;&amp;#039; alone would just be too meaningless or else I would just suggest it instead. [[User:Jebix|Jebix]] 04:37, 6 July 2006 (CEST)&lt;/div&gt;</summary>
		<author><name>Darloth</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Custom_functions&amp;diff=56440</id>
		<title>Custom functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Custom_functions&amp;diff=56440"/>
		<updated>2007-12-06T10:34:06Z</updated>

		<summary type="html">&lt;p&gt;Darloth: Reverting because I appear to be a fool who does not know how the program works. Please ignore my silly edit.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simple functions=&lt;br /&gt;
&lt;br /&gt;
You can write simple functions to make your spreadsheets more readable and easier to maintain. The process of developing and using these functions is very similar to other spreadsheet applications. For an introduction see [[Extensions development basic]]. Some examples in OpenOffice.org Basic follow. &lt;br /&gt;
&lt;br /&gt;
==Cell as an argument==&lt;br /&gt;
&amp;lt;code&amp;gt;[oobas]&lt;br /&gt;
Function Cube( c1 )&lt;br /&gt;
    Cube = c1 * c1 * c1&lt;br /&gt;
End Function&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
You can put &amp;#039;&amp;#039;=Cube(A1)&amp;#039;&amp;#039; in any cell. &lt;br /&gt;
&lt;br /&gt;
==More cells as the arguments==&lt;br /&gt;
&amp;lt;code&amp;gt;[oobas]&lt;br /&gt;
Function SimpleSum( c1, c2 )&lt;br /&gt;
    SimpleSum = c1 + c2&lt;br /&gt;
End Function&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
You can put &amp;#039;&amp;#039;=SimpleSum(A1;A2)&amp;#039;&amp;#039; in any cell. &lt;br /&gt;
&lt;br /&gt;
==Cells range as an argument==&lt;br /&gt;
&amp;lt;code&amp;gt;[oobas]&lt;br /&gt;
Function MySum( oRange As Variant )&lt;br /&gt;
If Not IsArray( oRange ) Then&lt;br /&gt;
        If IsNumeric( oRange ) Then&lt;br /&gt;
                MySum = oRange&lt;br /&gt;
        else&lt;br /&gt;
                MySum = 0&lt;br /&gt;
        End If&lt;br /&gt;
        Exit Function&lt;br /&gt;
End If&lt;br /&gt;
 &lt;br /&gt;
Dim nSum As double&lt;br /&gt;
 &lt;br /&gt;
nSum = 0&lt;br /&gt;
 &lt;br /&gt;
For i = 1 To ubound( oRange, 1 )&lt;br /&gt;
        For j = 1 To ubound( oRange, 2 )&lt;br /&gt;
 &lt;br /&gt;
                If IsNumeric( oRange( i, j ) ) Then&lt;br /&gt;
                        nSum = nSum + oRange( i, j )            &lt;br /&gt;
                End If&lt;br /&gt;
        Next j&lt;br /&gt;
Next i&lt;br /&gt;
 &lt;br /&gt;
MySum = nSum&lt;br /&gt;
End Function&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
You can put &amp;#039;&amp;#039;=MySum(A1:A3)&amp;#039;&amp;#039; in any cell. &lt;br /&gt;
&lt;br /&gt;
It is not possible to write to custom function that uses a cell range that spans sheets. E.g. &amp;lt;tt&amp;gt;=Sheet1.A2:Sheet2.A2&amp;lt;/tt&amp;gt; instead you would have to have separate parameters for each sheet.&lt;br /&gt;
&lt;br /&gt;
[[Category:Basic:Tutorials]]&lt;br /&gt;
[[Category:Calc]]&lt;/div&gt;</summary>
		<author><name>Darloth</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Custom_functions&amp;diff=56436</id>
		<title>Talk:Custom functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Custom_functions&amp;diff=56436"/>
		<updated>2007-12-06T09:59:05Z</updated>

		<summary type="html">&lt;p&gt;Darloth: Should semicolon necessity be even more obvious?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Where to put code ==&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s great to see some explanation on creating custom functions. I have not seen the functions I write show up in the function wizard in the &amp;#039;&amp;#039;&amp;#039;Function&amp;#039;&amp;#039;&amp;#039; list box of the &amp;#039;&amp;#039;&amp;#039;Functions&amp;#039;&amp;#039;&amp;#039; tab. This made me believe at first that I was not putting my custom function code in the right place or that I needed to change a setting.&lt;br /&gt;
&lt;br /&gt;
Could someone explain where exactly the code should be placed? [[User:Jebix|Jebix]] 04:04, 6 July 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
: Sorry I missed it. A good explanation about where to write code is already in the article [[Extensions development basic]] page. Maybe &amp;#039;&amp;#039;Extensions development basic&amp;#039;&amp;#039; is not the best name. I think &amp;#039;&amp;#039;OpenOffice.org Basic&amp;#039;&amp;#039; might be a better name. The title &amp;#039;&amp;#039;Basic&amp;#039;&amp;#039; alone would just be too meaningless or else I would just suggest it instead. [[User:Jebix|Jebix]] 04:37, 6 July 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
== Should semicolon necessity be even more obvious? ==&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ve added a note to the page about how you must use a semicolon instead of a comma to separate your arguments for custom functions, because I&amp;#039;ve just spent around 40 minutes looking for why my function wasn&amp;#039;t working and it came down to that. Silly I know, but if I did it I&amp;#039;m sure other people have done it too.&lt;br /&gt;
&lt;br /&gt;
However, do you think this is enough? Right now it&amp;#039;s a note under the second example - should it be even more obvious, perhaps as a note under the first paragraph? &amp;lt;br/&amp;gt;-- [[User:Darloth|Darloth]]&lt;/div&gt;</summary>
		<author><name>Darloth</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Custom_functions&amp;diff=56435</id>
		<title>Custom functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Custom_functions&amp;diff=56435"/>
		<updated>2007-12-06T09:57:13Z</updated>

		<summary type="html">&lt;p&gt;Darloth: mentioned semicolon instead of comma between arguments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simple functions=&lt;br /&gt;
&lt;br /&gt;
You can write simple functions to make your spreadsheets more readable and easier to maintain. The process of developing and using these functions is very similar to other spreadsheet applications. For an introduction see [[Extensions development basic]]. Some examples in OpenOffice.org Basic follow. &lt;br /&gt;
&lt;br /&gt;
==Cell as an argument==&lt;br /&gt;
&amp;lt;code&amp;gt;[oobas]&lt;br /&gt;
Function Cube( c1 )&lt;br /&gt;
    Cube = c1 * c1 * c1&lt;br /&gt;
End Function&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
You can put &amp;#039;&amp;#039;=Cube(A1)&amp;#039;&amp;#039; in any cell. &lt;br /&gt;
&lt;br /&gt;
==More cells as the arguments==&lt;br /&gt;
&amp;lt;code&amp;gt;[oobas]&lt;br /&gt;
Function SimpleSum( c1, c2 )&lt;br /&gt;
    SimpleSum = c1 + c2&lt;br /&gt;
End Function&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
You can put &amp;#039;&amp;#039;=SimpleSum(A1;A2)&amp;#039;&amp;#039; in any cell. &amp;lt;br/&amp;gt;&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Unlike normal functions, custom functions with multiple arguments must use a semicolon (;) and not a comma to separate function arguments&lt;br /&gt;
&lt;br /&gt;
==Cells range as an argument==&lt;br /&gt;
&amp;lt;code&amp;gt;[oobas]&lt;br /&gt;
Function MySum( oRange As Variant )&lt;br /&gt;
If Not IsArray( oRange ) Then&lt;br /&gt;
        If IsNumeric( oRange ) Then&lt;br /&gt;
                MySum = oRange&lt;br /&gt;
        else&lt;br /&gt;
                MySum = 0&lt;br /&gt;
        End If&lt;br /&gt;
        Exit Function&lt;br /&gt;
End If&lt;br /&gt;
 &lt;br /&gt;
Dim nSum As double&lt;br /&gt;
 &lt;br /&gt;
nSum = 0&lt;br /&gt;
 &lt;br /&gt;
For i = 1 To ubound( oRange, 1 )&lt;br /&gt;
        For j = 1 To ubound( oRange, 2 )&lt;br /&gt;
 &lt;br /&gt;
                If IsNumeric( oRange( i, j ) ) Then&lt;br /&gt;
                        nSum = nSum + oRange( i, j )            &lt;br /&gt;
                End If&lt;br /&gt;
        Next j&lt;br /&gt;
Next i&lt;br /&gt;
 &lt;br /&gt;
MySum = nSum&lt;br /&gt;
End Function&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
You can put &amp;#039;&amp;#039;=MySum(A1:A3)&amp;#039;&amp;#039; in any cell. &lt;br /&gt;
&lt;br /&gt;
It is not possible to write to custom function that uses a cell range that spans sheets. E.g. &amp;lt;tt&amp;gt;=Sheet1.A2:Sheet2.A2&amp;lt;/tt&amp;gt; instead you would have to have separate parameters for each sheet.&lt;br /&gt;
&lt;br /&gt;
[[Category:Basic:Tutorials]]&lt;br /&gt;
[[Category:Calc]]&lt;/div&gt;</summary>
		<author><name>Darloth</name></author>
	</entry>
</feed>