--
Regards
Frank Kabel
Frankfurt, Germany
When you are typing data in a cell you are in <ENTER> mode.
Excel has no way of knowing what is in a cell until you leave that cell by
Enter, TAB or arrowing out.
In short.....NO.
Gord Dibben Excel MVP
On Tue, 20 Apr 2004 14:48:38 -0400, Paul S Panoff <pan...@dteenergy.com>
wrote:
Sub testOnKey()
Application.OnKey "7", "OnKeySub"
End Sub
Sub resetOnKey()
Application.OnKey "7"
End Sub
Sub OnKeySub()
ActiveCell.Value = 7
ActiveCell.Offset(0, 1).Select
End Sub
At the very least you will have to set the OnKey procedure for each of
the numeric keys. Combine that with validation for non-numeric values.
Alternatively, you will have to define the OnKey procedure for *every*
keystroke. And, you can skip the validation stuff.
--
Regards,
Tushar Mehta
www.tushar-mehta.com
Business solutions leveraging technology
Microsoft Most Valuable Professional (MVP) 2000-2004
In article <40857086...@dteenergy.com>, pan...@dteenergy.com
says...
I must learn to never say "never"<g>
Gord
On Tue, 20 Apr 2004 16:52:30 -0400, Tushar Mehta
Add this code to the userform module:
Option Explicit
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case KeyAscii
Case 48 To 57 'Numbers 0-9
With ActiveCell
.Value = Chr(KeyAscii)
If .Column = 3 Then
.Offset(1, -2).Activate
Else
.Offset(0, 1).Activate
End If
End With
End Select
KeyAscii = 0
TextBox1.Value = ""
End Sub
Then add this to a general module to show the form:
Option Explicit
Sub testme01()
Cells(ActiveCell.Row, 1).Activate
UserForm1.Show
End Sub
I always start in column A and use A:C.
--
Dave Peterson
ec3...@msn.com
In article <ob5b801c6ktkbur52...@4ax.com>, Gord Dibben
<gorddibbATshawDOTca> says...
> Tushar
>
> I must learn to never say "never"<g>
Maybe, but the solution I proposed is sufficiently clumsy that it might
be better to say "never." <g>
--
Regards,
Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
In article <ob5b801c6ktkbur52...@4ax.com>, Gord Dibben
<gorddibbATshawDOTca> says...