Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default One letter per cell

I have a 5X5 grid which contains 25 cells. I want to restrict each cell so
that only one letter can be entered into it. And once that letter is entered
I want my cursor to tab to the next cell in the grid automatically. So you
don't have to press enter or tab. Is there a way to do this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default One letter per cell

Hi
I strongly suspect no. If you had such a facility then it would
automatically detect one character then stop you editing the cell
further. If you wanted to go back and edit the cell the same code
wouldn't let you....Cells can be contrived to have various activate
events (like click, double click etc) but typing a single character
isn't one of them. Possibly some clever way round this, but it may be
more bother than it is worth. Your users would expect to do something
after typing e.g. tab, return - and then you would get a double tab
(auto plus tab)!? Very annoying...
What you probably can do is force the cursor to go to the next cell in
the grid, without the user having to tab back to the start of the next
row. Would that do?
regards
Paul


On May 5, 2:31*pm, Bishop wrote:
I have a 5X5 grid which contains 25 cells. *I want to restrict each cell so
that only one letter can be entered into it. *And once that letter is entered
I want my cursor to tab to the next cell in the grid automatically. *So you
don't have to press enter or tab. *Is there a way to do this?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default One letter per cell

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 one
character.

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()
'Start in column A of the row with the activecell
ActiveSheet.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)

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

KeyAscii = 0
TextBox1.Value = ""

End Sub


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

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

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

Bishop wrote:

I have a 5X5 grid which contains 25 cells. I want to restrict each cell so
that only one letter can be entered into it. And once that letter is entered
I want my cursor to tab to the next cell in the grid automatically. So you
don't have to press enter or tab. Is there a way to do this?


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default One letter per cell

What if I was just looking for a specific letter? The way the grid is set up
it already has the letter P in each of the 25 cells. I already have it set
up so that you can only put a P or an F in the cell. So unless the user
needs to change the value to F they just leave the cell alone. Is there a
way to autotab if the value entered is F?

Something like:

If cell.value = F,f then tab

" wrote:

Hi
I strongly suspect no. If you had such a facility then it would
automatically detect one character then stop you editing the cell
further. If you wanted to go back and edit the cell the same code
wouldn't let you....Cells can be contrived to have various activate
events (like click, double click etc) but typing a single character
isn't one of them. Possibly some clever way round this, but it may be
more bother than it is worth. Your users would expect to do something
after typing e.g. tab, return - and then you would get a double tab
(auto plus tab)!? Very annoying...
What you probably can do is force the cursor to go to the next cell in
the grid, without the user having to tab back to the start of the next
row. Would that do?
regards
Paul


On May 5, 2:31 pm, Bishop wrote:
I have a 5X5 grid which contains 25 cells. I want to restrict each cell so
that only one letter can be entered into it. And once that letter is entered
I want my cursor to tab to the next cell in the grid automatically. So you
don't have to press enter or tab. Is there a way to do this?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make First letter of the cell in capital letter Irshad Alam Excel Programming 17 September 7th 08 04:14 PM
New Validation option to format 1st letter as Capital letter Jeff Excel Discussion (Misc queries) 5 July 13th 06 05:11 AM
column header changed from letter to number, how return to letter Ron Excel Discussion (Misc queries) 2 May 9th 05 08:34 PM
if a cell = a particular letter or even contains that letter Brian Excel Worksheet Functions 3 February 28th 05 06:58 AM
press letter and go 2 entry begin w letter in data validation drop MCP Excel Programming 1 August 28th 04 05:07 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"