Thread: Keypress
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default Keypress

On way. In a standard code module add this code

Public fChangeEnabled As Boolean

Sub StartOnKey()
Application.OnKey "E", "EnableChange"
Application.OnKey "R", "DisableChange"
End Sub


Sub EnableChange()
fChangeEnabled = True
End Sub

Sub DisableChange()
fChangeEnabled = False
End Sub

and in your change event, test i fChangeEnabled - True. If not, exit.

--
HTH

Bob Phillips

"broogle" wrote in message
ups.com...
Please help,

I have a worksheet_change event, I want to disable this event if key
"E" is pressed and enable it again if key "R" is pressed. Is it
possible? How can I do that?

Thanks