how can i use application.onkey once, no need typing another key to terminate onkey.
You can't.
Try this:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Address
Case "$A$1": Application.OnKey "~", "Macro1"
Case Else: Application.OnKey "~", "Macro2"
End Select
End Sub
Sub Macro1()
Application.OnKey "~"
MsgBox "Hello!"
End Sub
Sub Macro2()
Application.OnKey "~"
MsgBox ActiveCell.Address & ": " & "Hi ya!"
End Sub
Or This:
Sub Macro3()
OnKeyClear_Tilde
MsgBox "Hello!"
End Sub
Sub OnKeyClear_Tilde()
Application.OnKey "~"
End Sub
Sub OnKeyClear_Tab()
Application.OnKey "[TAB}"
End Sub