LibreOffice 7.3 Hjelp
Defines the error message that is displayed when invalid data is entered in a cell.
Du kan også starte en makro med en feilmelding. Et eksempel på en slik makro er vist sist på denne siden.
Displays the error message that you enter in the Contents area when invalid data is entered in a cell. If enabled, the message is displayed to prevent an invalid entry.
I begge tilfeller, hvis du velger «Stopp», blir det ugyldige elementet slettet og forrige verdi blir satt inn på nytt i cellen. Det samme gjelder hvis du lukker dialogvinduene «Advarsel» og «Informasjon» ved å trykk på Avbryt-knappen. Hvis du lukker dialogvinduene med knappen OK, blir ikke det ugyldige elementet slettet.
Select the action that you want to occur when invalid data is entered in a cell. The "Stop" action rejects the invalid entry and displays a dialog that you have to close by clicking OK. The "Warning" and "Information" actions display a dialog that can be closed by clicking OK or Cancel. The invalid entry is only rejected when you click Cancel.
Opens the Macro dialog where you can select the macro that is executed when invalid data is entered in a cell. The macro is executed after the error message is displayed.
Skriv inn tittelen på makroen eller feilmeldinga som skal vises når ugyldige data blir skrevet inn i en celle.
Skriv inn meldinga som skal vises når det blir skrevet inn ugyldige verdier i en celle.
Below is a sample function that can be called when an error occurs. Note that the macro takes in two parameters that are passed on by LibreOffice when the function is called:
CellValue: The value entered by the user, as a String.
CellAddress : Adressen til cellen der verdien ble angitt, som en streng som prefikset med arkenavnet (f.eks. "Sheet1.A1").
The function must return a Boolean value. If it returns True, the entered value is kept. If the function returns False, the entered value is erased and the previous value is restored.
Function ExampleValidity(CellValue as String, CellAddress as String) as Boolean
Dim msg as String
Dim iAnswer as Integer
Dim MB_FLAGS as Integer
msg = "Invalid value: " & "'" & CellValue & "'"
msg = msg & " in cell: " & "'" & CellAddress & "'"
msg = msg & Chr(10) & "Accept anyway?"
MB_FLAGS = MB_YESNO + MB_ICONEXCLAMATION + MB_DEFBUTTON2
iAnswer = MsgBox (msg , MB_FLAGS, "Error message")
ExampleValidity = (iAnswer = IDYES)
End Function