오류 메시지

Defines the error message that is displayed when invalid data is entered in a cell.

오류 메시지와 함께 매크로를 시작할 수도 있습니다. 이 페이지의 끝에서 샘플 매크로가 제공됩니다.

이 명령을 사용하려면...

From the menu bar:

Choose Data - Validity - Error Alert tab.

From the tabbed interface:

On the Data menu of the Data tab, choose Validity - Error Alert tab.


유효하지 않은 수치 입력시 오류 메시지 표시

올바르지 않은 데이터가 셀에 입력되었을 때 내용 영역에 입력한 오류 메시지를 표시합니다. 이를 사용하면 잘못된 입력을 방지하는 메시지가 표시됩니다.

어떠한 경우든 "정지"를 선택하면 잘못된 항목이 삭제되고 이전 값이 셀에 다시 입력됩니다. 이는 취소 버튼을 눌러 "경고" 및 "정보" 대화 상자를 닫을 경우에도 동일하게 적용됩니다. 확인 버튼을 눌러 대화 상자를 닫을 경우에는 잘못된 항목이 삭제되지 않습니다.

내용

동작

잘못된 데이터가 셀에 입력될 때 수행할 작동을 선택합니다. "정지" 작동은 잘못된 항목을 거부하고 확인을 눌러 닫아야 하는 대화 상자를 표시합니다. "경고" 및 "정보" 작동은 확인 또는 취소를 눌러 닫을 수 있는 대화 상자를 표시합니다. 잘못된 항목은 취소를 누를 경우에만 거부됩니다.

찾아보기

잘못된 데이터가 셀에 입력될 경우 실행할 매크로를 선택할 수 있는 매크로 대화 상자를 엽니다. 매크로는 오류 메시지가 표시된 후에 실행됩니다.

제목

잘못된 데이터가 셀에 입력될 경우 표시할 매크로 또는 오류 메시지의 제목을 입력합니다.

오류 메시지

잘못된 데이터가 셀에 입력될 경우 표시할 메시지를 입력합니다.

Sample macro:

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:

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