Option Explicit
' This is a simple example of using the OnEntry property. The Auto_Open sub calls the Action
' sub. The font is set to bold in the ActiveCell if the value is >= 500. Thus if the value is >=500,
' then ActiveCell.Font.Bold = True. If the value is less than 500, then ActiveCell.Font.Bold = False.
' The Auto_Close sub "turns off" OnEntry.
Sub Auto_Open()
ActiveSheet.OnEntry = "Action"
End Sub
Sub Action1()
If Not IsNumeric(ActiveCell) Then
'ActiveCell.Font.Bold = ActiveCell.Value >= 500
MsgBox " du lieu ban voa khong phia la so"
End If
End Sub
Sub Action()
If Not IsNumeric(ActiveCell) Then
'ActiveCell.Font.Bold = ActiveCell.Value >= 500
MsgBox " du lieu ban voa khong phia la so, hay voa lai du lieu"
ActiveCell = ""
End If
End Sub
Sub Auto_Close()
ActiveSheet.OnEntry = ""
End Sub