Keypress 
Author Message
 Keypress

hi,

after protecting a sheet, the focus of a cell moves to the next possible
cell by hitting the tabkey.

like in my vb programs, i'd like to move the focus to the next available
cell by pressing the returnkey as well. i found a routin earlier but it
won't work. also i would only like to allow the input of only numbers on the
whole sheet. how can this be done and where would this event go?

thanks,

jerry



Thu, 05 May 2005 19:07:42 GMT  
 Keypress
you can use the sheet's Change event ... this is fired whenever something is
entered. The changed cell is passed to the sub so that you can test it.

Private Sub Worksheet_Change(ByVal Target As Range)
  If Not IsNumeric(Target.Value) Then
      Target.Value = 0
  End If
End Sub

--
Patrick Molloy
Microsoft Excel MVP
----------------------------------

Quote:
> hi,

> after protecting a sheet, the focus of a cell moves to the next possible
> cell by hitting the tabkey.

> like in my vb programs, i'd like to move the focus to the next available
> cell by pressing the returnkey as well. i found a routin earlier but it
> won't work. also i would only like to allow the input of only numbers on
the
> whole sheet. how can this be done and where would this event go?

> thanks,

> jerry



Thu, 05 May 2005 21:08:24 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. In vbs exist the keypress event

2. Keypress event

3. Disabling shift keypress that prevents code execution

4. Keypress Counter

5. Capture keypress

6. Exit Loop on keypress?

7. Help with Keypress

8. Can VBA intercept keypress within Excel ?

9. Recognizing keypresses

10. Dialog Button Keypress


 
Powered by phpBB® Forum Software © phpBB Group