+ Reply to Thread
Results 1 to 14 of 14

Tabbing from Cell to ComboBox

Hybrid View

  1. #1
    Registered User
    Join Date
    10-19-2007
    Posts
    29
    Bettatronic - thanks I'll look at this tomorrow when the level of red wine decreases and it makes more sense!

  2. #2
    Registered User
    Join Date
    01-16-2007
    Location
    Near the box
    Posts
    58
    The wine definitely away ?

    As I've seen inside your sheet it's needed to hold the default excel's TAB behaviour. So solution via OnKey method is forbidden now.

    So something else. Here we check outgoing cells, in your case it's the celll above the combobox. Once the cell is left we focus the combobox.

    Combobox has some key event too to focus next cell below.

    module1::
    Public last_adr As String
    
    Public Sub set_control_focus(ByVal objname As String)
        Dim obj As OLEObject
        On Error GoTo err
        Set obj = Worksheets(1).OLEObjects(objname)
            obj.Activate
        Exit Sub
    err:
    End Sub
    Workbook event::
    Private Sub Workbook_Open()
        last_adr = ""
    End Sub
    
    Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
        If last_adr <> "" And last_adr = "$F$11" Then set_control_focus objname:="ComboBox1"
        last_adr = Target.Address
    End Sub
    ComboBox1 event::
    Private Sub ComboBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
        If KeyCode = 9 Then Worksheets(1).Range("F15").Select
    End Sub
    Have fun !
    Attached Files Attached Files
    Last edited by bettatronic; 10-19-2007 at 09:14 PM.
    ? ? ? I like the way how Excel can access system API. Really cool ! ? ? ?

  3. #3
    Registered User
    Join Date
    10-19-2007
    Posts
    29
    This doesn't seem to do the trick when I incorporate the code into my workbook. Can you implement it on the test file that I posted? I see that it sort of works on the file that you attached.

    Thanks (now with a clearer head)

  4. #4
    Registered User
    Join Date
    01-16-2007
    Location
    Near the box
    Posts
    58
    Hi Nicki,

    of course i can try within your test sheet. But what about the test sheet protection ? Any key ? Or post the sheet once again but with unprotected VB.

  5. #5
    Registered User
    Join Date
    10-19-2007
    Posts
    29
    Bettatronic - sorry, the password is "SkimmedMilk"

    Thanks
    Nicki

  6. #6
    Registered User
    Join Date
    01-16-2007
    Location
    Near the box
    Posts
    58
    Try it Nicki. shift+PageDown to view full list. I hope this help to you.

    Have fun !
    Attached Files Attached Files
    Last edited by bettatronic; 10-20-2007 at 12:20 PM.

  7. #7
    Registered User
    Join Date
    10-19-2007
    Posts
    29

    Thumbs up

    What a star, that is perfect, thank you so much

+ 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