LibreOffice 7.1 Help
Du kan anvÀnda anvÀndardefinierade funktioner i LibreOffice Calc pÄ följande sÀtt:
Du kan definiera egna funktioner med hjÀlp av Basic-IDE. Den hÀr metoden krÀver grundlÀggande programmeringskunskaper.
Du kan programmera funktionen som tillÀgg. Den hÀr metoden krÀver avancerade programmeringskunskaper.
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
StÀng Basic-IDE-fönstret.
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.
I steg 2 i "Definiera en funktion med hjÀlp av LibreOffice Basic" klickade du pÄ Redigera i dialogrutan Makro. Som standard markeras modulen Mina makron - Standard - Modul1 i fÀltet Makro frÄn. Standard-biblioteket lagras lokalt i anvÀndarkatalogen.
Om du vill kopiera den anvÀndardefinierade funktionen till ett Calc dokument gör du sÄ hÀr:
Choose .
Markera Mina makron - Standard - Modul1 i fÀltet Makro frÄn och klicka pÄ Redigera.
I Basic-IDE markerar du kÀllan för den anvÀndardefinierade funktionen och kopierar den till urklipp.
StÀng Basic-IDE-fönstret.
Choose .
Markera (Namn pÄ Calc dokument) - Standard - Modul1 i fÀltet Makro frÄn. Klicka pÄ Redigera.
Klistra in innehÄllet i urklippet i Basic-IDE:n till dokumentet.
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 LibreOffice Calc.
Open a Calc document and enter numbers for the function parameters a, b and c in cells A1, B1, and C1.
Placera markören i en annan cell och skriv följande:
=VOL(A1;B1;C1)
Funktionen berÀknas och resultatet visas i den markerade cellen.