PC Review


Reply
Thread Tools Rate Thread

ComboBox Focus

 
 
MikeF
Guest
Posts: n/a
 
      13th Jan 2009
Am using an ActiveX ComboBox, presently with no VBA code.

It "word searches" just fine, but then doesn't "do" anything once the choice
is made, ie retains its focus.
Hitting tab or enter does not return focus to Excel, the user has to
physically grab the mouse and click in a cell.

Hitting the tab key to return focus to Excel would be ideal.

Any ideas?

Regards,
- Mike


 
Reply With Quote
 
 
 
 
FSt1
Guest
Posts: n/a
 
      13th Jan 2009
hi
where do you want it to go once the tab key is pressed?
the escape key works .....ok. takes you to the last cell selected before
entering the combo box.
you could add some code to make it go were you want after the selection is
made.
Private Sub ComboBox1_Change()
Range("A1").Select 'or where ever
End Sub

code would eliminate the need to press a key after the selection.
my thoughts
regards
FSt1



"MikeF" wrote:

> Am using an ActiveX ComboBox, presently with no VBA code.
>
> It "word searches" just fine, but then doesn't "do" anything once the choice
> is made, ie retains its focus.
> Hitting tab or enter does not return focus to Excel, the user has to
> physically grab the mouse and click in a cell.
>
> Hitting the tab key to return focus to Excel would be ideal.
>
> Any ideas?
>
> Regards,
> - Mike
>
>

 
Reply With Quote
 
MikeF
Guest
Posts: n/a
 
      13th Jan 2009
Thanx.
You're right, the ESC key does work ok.
The range.select code is also ok, if you're only using the drop-down with a
mouse.
Using word-search with the keyboard, it jumps immediately to the designated
cell after the first letter typed.

Again, ideally would like to assign the tab key to it, and just "tab off"
after making the selection, but perhaps that is not possible.

- Mike

"FSt1" wrote:

> hi
> where do you want it to go once the tab key is pressed?
> the escape key works .....ok. takes you to the last cell selected before
> entering the combo box.
> you could add some code to make it go were you want after the selection is
> made.
> Private Sub ComboBox1_Change()
> Range("A1").Select 'or where ever
> End Sub
>
> code would eliminate the need to press a key after the selection.
> my thoughts
> regards
> FSt1
>
>
>
> "MikeF" wrote:
>
> > Am using an ActiveX ComboBox, presently with no VBA code.
> >
> > It "word searches" just fine, but then doesn't "do" anything once the choice
> > is made, ie retains its focus.
> > Hitting tab or enter does not return focus to Excel, the user has to
> > physically grab the mouse and click in a cell.
> >
> > Hitting the tab key to return focus to Excel would be ideal.
> >
> > Any ideas?
> >
> > Regards,
> > - Mike
> >
> >

 
Reply With Quote
 
CraigB
Guest
Posts: n/a
 
      23rd Feb 2009
I am having the same problem and I am totally stumped. I have founds some
code snippets on Debra's site. It looks something like this:

Private Sub TempCombo_KeyDown(ByVal _
KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Select Case KeyCode
Case 9 'Tab
ActiveCell.Offset(0, 1).Activate
Case 13 'Enter
ActiveCell.Offset(1, 0).Activate
Case Else
'do nothing
End Select
End Sub

I am getting some really funky results though. I am substituting 'TempCombo'
with one of my activeX combo boxes.....Very rusty on my VB. Tab seems to hop
around, but not where I want it to. Once it has hopped back into excel and I
go back into combo box to delete the contents, it also will just bounce
around....arrgggh!

"MikeF" wrote:

> Thanx.
> You're right, the ESC key does work ok.
> The range.select code is also ok, if you're only using the drop-down with a
> mouse.
> Using word-search with the keyboard, it jumps immediately to the designated
> cell after the first letter typed.
>
> Again, ideally would like to assign the tab key to it, and just "tab off"
> after making the selection, but perhaps that is not possible.
>
> - Mike
>
> "FSt1" wrote:
>
> > hi
> > where do you want it to go once the tab key is pressed?
> > the escape key works .....ok. takes you to the last cell selected before
> > entering the combo box.
> > you could add some code to make it go were you want after the selection is
> > made.
> > Private Sub ComboBox1_Change()
> > Range("A1").Select 'or where ever
> > End Sub
> >
> > code would eliminate the need to press a key after the selection.
> > my thoughts
> > regards
> > FSt1
> >
> >
> >
> > "MikeF" wrote:
> >
> > > Am using an ActiveX ComboBox, presently with no VBA code.
> > >
> > > It "word searches" just fine, but then doesn't "do" anything once the choice
> > > is made, ie retains its focus.
> > > Hitting tab or enter does not return focus to Excel, the user has to
> > > physically grab the mouse and click in a cell.
> > >
> > > Hitting the tab key to return focus to Excel would be ideal.
> > >
> > > Any ideas?
> > >
> > > Regards,
> > > - Mike
> > >
> > >

 
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
Which combobox has the focus? =?Utf-8?B?RGFuaWVsIEJvbmFsbGFjaw==?= Microsoft Excel Programming 5 1st Jun 2006 02:20 AM
HowTo? shift focus in VBA IDE between Object combobox, procedure combobox, and Code window Malcolm Cook Microsoft Access 0 11th Oct 2005 03:42 PM
ComboBox and Set Focus Ming Shao Microsoft Excel Programming 1 28th Apr 2004 06:55 PM
Focus on combobox atkscott Microsoft Excel Programming 4 20th Nov 2003 12:36 AM
ComboBox - set focus? Ed Stewart Microsoft C# .NET 1 7th Oct 2003 07:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:44 AM.