LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
PO PO is offline
external usenet poster
 
Posts: 66
Default Using textboxes in sheets

Hi

I have a worksheet containing 22 textboxes. They don't seem to have a built
in tab-function. I've tried to use the key_down sub:

Private Sub TextBox01_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 9 or KeyCode = 13 Then TextBox02.Activate
End Sub

I don't want to copy the code 22 times (for all 22 textboxes - the code
quickly get unreadable), there must be a way to capture the keystrokes in
one event and then call a public sub with the textbox name as an
argument...for instance:

Sub Tabhandler(ByVal TextBoxName as String)
Dim strNr as String

strNr=Right(TextBoxName,2)
strNr=StrNr+1
ActiveSheet.Shapes(strNr).SetFocus
End Sub

I just want the user to be able to tab between all the textboxes in my
worksheet.
Perhaps there are other solutions to this problem?

TIA
PO


 
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
Textboxes SAL Excel Discussion (Misc queries) 2 July 13th 07 12:24 AM
tab between several textboxes Kim Excel Worksheet Functions 0 May 9th 05 04:08 PM
Dates in TextBoxes James[_25_] Excel Programming 3 July 15th 04 01:53 PM
Textboxes Marcotte A Excel Programming 2 July 7th 04 12:55 AM
textboxes libby Excel Programming 5 April 13th 04 06:32 PM


All times are GMT +1. The time now is 08:21 PM.

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

About Us

"It's about Microsoft Excel"