I can colour a cell using conditional formatting. But how can I set a sound alert when a cell has turned positive?
Thank you for your help.
答案 0 :(得分:1)
转到Tools -> Macros -> Organize Macros -> LibreOffice Basic
并添加以下代码:
Sub ContentChanged (oCellChanged As Object)
oSheet = ThisComponent.Sheets(0)
oCell = oSheet.getCellRangeByName("A1")
If oCell.getValue() > 0 Then
Beep
End If
End Sub
然后转到表单1,右键单击选项卡并选择Sheet Events
。将Content changed
事件设置为指向宏。
现在,当单元格A1大于零时,它会发出蜂鸣声。