PC Review


Reply
Thread Tools Rate Thread

How do I limit a cell to one digit and have it automatically tab?

 
 
HJB1954
Guest
Posts: n/a
 
      17th Jun 2008
I am trying to enter one digit numbers to cells. I would like for Excel to
automatically tab me to the next cell without having to hit the enter or tab
key. Is it possible??

Thanks,

Harold Buchanan
 
Reply With Quote
 
 
 
 
Jim Thomlinson
Guest
Posts: n/a
 
      17th Jun 2008
Not possible. There is no buillt in feature to allow this and macros are
suspended while you are entering data in a cell.
--
HTH...

Jim Thomlinson


"HJB1954" wrote:

> I am trying to enter one digit numbers to cells. I would like for Excel to
> automatically tab me to the next cell without having to hit the enter or tab
> key. Is it possible??
>
> Thanks,
>
> Harold Buchanan

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      17th Jun 2008
Without knowing what "the next cell" means...

Saved from a previous post:

I would turn
tools|options|edit tab|move selection after enter
to down or right or ...

Then turn number lock on and use the numeric keypad to type your digit

Hitting the enter key on the numeric keypad doesn't seem too bad to me.

Another alternative is to create a tiny userform that just looks for a digit:

Put a single textbox on it (use the X button to close the userform).

Put this code in a General module:

Option Explicit
Sub testme01()
Cells(ActiveCell.Row, 1).Activate
UserForm1.Show
End Sub

Add this code to the userform module:

Option Explicit
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

Select Case KeyAscii
Case 48-57 'Numbers 0-9
With ActiveCell
.Value = Chr(KeyAscii)
'A:E, then down a row
if activecell.column = 5 then
activecell.entirerow.cells(1).offset(1,0).activate
else
.Offset(0, 1).Activate
end if
End With
End Select
KeyAscii = 0
TextBox1.Value = ""

End Sub

This code goes from A:E then next row, column A.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Debra Dalgleish has some getstarted instructions for userforms at:
http://contextures.com/xlUserForm01.html

HJB1954 wrote:
>
> I am trying to enter one digit numbers to cells. I would like for Excel to
> automatically tab me to the next cell without having to hit the enter or tab
> key. Is it possible??
>
> Thanks,
>
> Harold Buchanan


--

Dave Peterson
 
Reply With Quote
 
HJB1954
Guest
Posts: n/a
 
      17th Jun 2008
Not the answer I wanted to hear, but at least I know. Thanks for responding.

Harold Buchanan

"Jim Thomlinson" wrote:

> Not possible. There is no buillt in feature to allow this and macros are
> suspended while you are entering data in a cell.
> --
> HTH...
>
> Jim Thomlinson
>
>
> "HJB1954" wrote:
>
> > I am trying to enter one digit numbers to cells. I would like for Excel to
> > automatically tab me to the next cell without having to hit the enter or tab
> > key. Is it possible??
> >
> > Thanks,
> >
> > Harold Buchanan

 
Reply With Quote
 
HJB1954
Guest
Posts: n/a
 
      17th Jun 2008
Wow! I am afraid I am in over my head. I have written a program that
calculates the bets we have made while playing golf. As each team comes in,
they give me the scores for each hole. I then enter them and the simple
programming I have done calculates the bets.

As they call out, 5, 4, 3, 5, 4, 2, 4,4,4, I would like to be able to go to
the cell for hole number one and enter 5.

Will the formula you wrote let me enter 5 and then go to the cell which is
adjacent to it and enter 4 without having to tab to that cell.

If so, I will get more familiar with userforms and use your suggestion.

Thanks for responding.

Harold Buchanan

"Dave Peterson" wrote:

> Without knowing what "the next cell" means...
>
> Saved from a previous post:
>
> I would turn
> tools|options|edit tab|move selection after enter
> to down or right or ...
>
> Then turn number lock on and use the numeric keypad to type your digit
>
> Hitting the enter key on the numeric keypad doesn't seem too bad to me.
>
> Another alternative is to create a tiny userform that just looks for a digit:
>
> Put a single textbox on it (use the X button to close the userform).
>
> Put this code in a General module:
>
> Option Explicit
> Sub testme01()
> Cells(ActiveCell.Row, 1).Activate
> UserForm1.Show
> End Sub
>
> Add this code to the userform module:
>
> Option Explicit
> Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
>
> Select Case KeyAscii
> Case 48-57 'Numbers 0-9
> With ActiveCell
> .Value = Chr(KeyAscii)
> 'A:E, then down a row
> if activecell.column = 5 then
> activecell.entirerow.cells(1).offset(1,0).activate
> else
> .Offset(0, 1).Activate
> end if
> End With
> End Select
> KeyAscii = 0
> TextBox1.Value = ""
>
> End Sub
>
> This code goes from A:E then next row, column A.
>
> If you're new to macros, you may want to read David McRitchie's intro at:
> http://www.mvps.org/dmcritchie/excel/getstarted.htm
>
> Debra Dalgleish has some getstarted instructions for userforms at:
> http://contextures.com/xlUserForm01.html
>
> HJB1954 wrote:
> >
> > I am trying to enter one digit numbers to cells. I would like for Excel to
> > automatically tab me to the next cell without having to hit the enter or tab
> > key. Is it possible??
> >
> > Thanks,
> >
> > Harold Buchanan

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      17th Jun 2008
It's not a formula--it's a macro.

It will allow you to enter a single digit and go to the adjacent cell. You may
have to modify the code so that it goes to the next row after the 9th entry,
though.

HJB1954 wrote:
>
> Wow! I am afraid I am in over my head. I have written a program that
> calculates the bets we have made while playing golf. As each team comes in,
> they give me the scores for each hole. I then enter them and the simple
> programming I have done calculates the bets.
>
> As they call out, 5, 4, 3, 5, 4, 2, 4,4,4, I would like to be able to go to
> the cell for hole number one and enter 5.
>
> Will the formula you wrote let me enter 5 and then go to the cell which is
> adjacent to it and enter 4 without having to tab to that cell.
>
> If so, I will get more familiar with userforms and use your suggestion.
>
> Thanks for responding.
>
> Harold Buchanan
>
> "Dave Peterson" wrote:
>
> > Without knowing what "the next cell" means...
> >
> > Saved from a previous post:
> >
> > I would turn
> > tools|options|edit tab|move selection after enter
> > to down or right or ...
> >
> > Then turn number lock on and use the numeric keypad to type your digit
> >
> > Hitting the enter key on the numeric keypad doesn't seem too bad to me.
> >
> > Another alternative is to create a tiny userform that just looks for a digit:
> >
> > Put a single textbox on it (use the X button to close the userform).
> >
> > Put this code in a General module:
> >
> > Option Explicit
> > Sub testme01()
> > Cells(ActiveCell.Row, 1).Activate
> > UserForm1.Show
> > End Sub
> >
> > Add this code to the userform module:
> >
> > Option Explicit
> > Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
> >
> > Select Case KeyAscii
> > Case 48-57 'Numbers 0-9
> > With ActiveCell
> > .Value = Chr(KeyAscii)
> > 'A:E, then down a row
> > if activecell.column = 5 then
> > activecell.entirerow.cells(1).offset(1,0).activate
> > else
> > .Offset(0, 1).Activate
> > end if
> > End With
> > End Select
> > KeyAscii = 0
> > TextBox1.Value = ""
> >
> > End Sub
> >
> > This code goes from A:E then next row, column A.
> >
> > If you're new to macros, you may want to read David McRitchie's intro at:
> > http://www.mvps.org/dmcritchie/excel/getstarted.htm
> >
> > Debra Dalgleish has some getstarted instructions for userforms at:
> > http://contextures.com/xlUserForm01.html
> >
> > HJB1954 wrote:
> > >
> > > I am trying to enter one digit numbers to cells. I would like for Excel to
> > > automatically tab me to the next cell without having to hit the enter or tab
> > > key. Is it possible??
> > >
> > > Thanks,
> > >
> > > Harold Buchanan

> >
> > --
> >
> > Dave Peterson
> >


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional format on first & last digit on 3 digit cell data caprey Microsoft Excel New Users 3 17th Dec 2008 05:24 PM
Move to next cell automatically after typing one digit avi Microsoft Excel Programming 2 6th Dec 2008 10:19 PM
Can excel limit the characters in a cell to 28 automatically? =?Utf-8?B?VG9t?= Microsoft Excel Worksheet Functions 1 2nd Feb 2006 04:28 PM
Color a single digit in a mult-digit number cell =?Utf-8?B?UGh5bGxpcw==?= Microsoft Excel Misc 6 17th Nov 2005 12:46 AM
Excel: let me a color a single digit in a multi-digit cell =?Utf-8?B?UGh5bGxpcw==?= Microsoft Frontpage 6 13th Nov 2005 11:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:28 AM.