Collabora Office 21.06 ヘルプ
ユーザー定義の関数は、Collabora Office Calc で次のように操作します:
Basic-IDE を使用すれば、プログラミングの詳しい知識がなくても、独自の関数を作成できます。
関数をアドインとしてプログラミングする方法を説明しています。この方法はプログラミングに関する高度な知識を必要とします。
Choose
.You will now see the Basic IDE.
In the Object Catalog window, double-click on the module where you want to store your macro.
Enter the function code. In this example, we define a VOL(a; b; c) function that calculates the volume of a rectangular solid with side lengths a, b and c:
Function VOL(a, b, c)
VOL = a*b*c
End Function
Basic-IDE ウィンドウを閉じます。
Your function is automatically saved in the selected module and is now available. If you apply the function in a Calc document that is to be used on another computer, you can copy the function to the Calc document as described in the next section.
「独自の関数を Collabora Office Basic で定義する」の手順 2 で マクロ ダイアログの 編集 をクリックしました。標準設定では マイマクロ → Standard → Module1 で マクロの記録先 が選択されています。この Standard ライブラリは、ユーザーディレクトリにあります。
ユーザーが定義した関数を Calc ドキュメントにコピーするには、次の操作を行ないます:
Choose
.マクロの記録先 フィールドから マイマクロ → Standard → Module1 を選択した上で 編集 ボタンをクリックします。
Basic-IDE でユーザーが定義した関数のソースを選択して、クリップボードにコピーします。
Basic-IDE を閉じます。
Choose
.マクロの記録先 フィールドから (Calc ドキュメント名) → Standard → Module1 を選択して 編集 ボタンをクリックします。
ドキュメントの Basic-IDE にクリップボードの内容を貼り付けます。
Once you have defined the function VOL(a; b; c) in the Basic-IDE, you can apply it the same way as the built-in functions of Collabora Office Calc.
Open a Calc document and enter numbers for the function parameters a, b and c in cells A1, B1, and C1.
カーソルを別のセルに置き、次のように入力します:
=VOL(A1;B1;C1)
関数が適用され、結果が選択したセルに表示されます。