+ Reply to Thread
Results 1 to 3 of 3

"Tabbing" code crashing xl2002 WinXP

  1. #1
    Matt Jensen
    Guest

    "Tabbing" code crashing xl2002 WinXP

    Howdy
    Put 2 control toolbar text boxes on a worksheet named Textbox1 and
    TextBox2.
    Then in the code for the same sheet put this code:

    Private Sub Textbox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
    ByVal Shift As Integer)
    If KeyCode = 9 Then
    If Shift > 0 Then
    'nothing
    Else
    Worksheets("Sheet1").Range("A1").Activate
    TextBox2.Activate
    End If
    End If
    End Sub


    When not in design mode, you click in TextBox1 and hit the 'tab' key
    xl2002 on WinXP crashes for me.

    Anyone know any code that will work on both 97 and 2002 for tabbing
    between boxes?
    Thanks
    Matt


  2. #2
    Tom Ogilvy
    Guest

    Re: "Tabbing" code crashing xl2002 WinXP

    I could reproduce it in Excel 2002, Win 2000

    This worked: (using KeyUp)
    Private Sub Textbox1_Keyup(ByVal KeyCode As MSForms.ReturnInteger, ByVal
    Shift As Integer)
    If KeyCode = 9 Then
    If Shift > 0 Then
    'nothing
    Else
    ActiveCell.Activate
    TextBox2.Activate
    End If
    End If
    End Sub

    --
    Regards,
    Tom Ogilvy


    "Matt Jensen" <[email protected]> wrote in message
    news:[email protected]...
    > Howdy
    > Put 2 control toolbar text boxes on a worksheet named Textbox1 and
    > TextBox2.
    > Then in the code for the same sheet put this code:
    >
    > Private Sub Textbox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
    > ByVal Shift As Integer)
    > If KeyCode = 9 Then
    > If Shift > 0 Then
    > 'nothing
    > Else
    > Worksheets("Sheet1").Range("A1").Activate
    > TextBox2.Activate
    > End If
    > End If
    > End Sub
    >
    >
    > When not in design mode, you click in TextBox1 and hit the 'tab' key
    > xl2002 on WinXP crashes for me.
    >
    > Anyone know any code that will work on both 97 and 2002 for tabbing
    > between boxes?
    > Thanks
    > Matt
    >




  3. #3
    Matt Jensen
    Guest

    Re: "Tabbing" code crashing xl2002 WinXP

    Once again, great thanks Tom
    Matt


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1