tab to select combo box instead of field?

P

Pam

I have a worksheet with several combo boxes and the work great as far as
typing in the first letter and it auto completing.
My problem is, many of our users want to "tab" to the next field, and they
get in the field, but they don't actually select the combo box until they
mouse click on it.
Is there some way I can set this so that they can tab to it and actually
select the combobox instead of the cell behind it?
Thanks for any help you can give me
 
C

carlo

You could lookup the value of the onchange event and change it to the
combobox:
----------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Select Case Target.Address
Case Is = "$B$2"
ComboBox1.Activate
Case Is = "$B$4"
ComboBox2.Activate
End Select

End Sub
----------------------------------------
Adjust the ranges and the ComboBox-names. If there are a lot of
comboboxes it'll be a little complex.

This code has to be inserted in the Worksheet module you want the code
to work. To do that, right click on the Worksheet-tab and click "View
Code..."

hth

Carlo
 
P

Pam

I tried that but it didn't work, I type the first letter and the combox box
fills, but when I hit tab or enter, it doesn't move. Is there something in
the properties about matching I need to change?
Thank you
 
C

carlo

Hi Pam

well, my code only works from worksheet to combobox, not vice versa.
Where do you want to go from your combobox, to the next combobox
or to a range?

Cheers

Carlo
 
P

Pam

Thanks Carlo,
I want to go from a cell to a combo box, then to the next cell. The combo
boxes are spread throughout the worksheet, ie.. one for state, one for
company, one for sales rep name, but the other information is just plain
cells. I hope that makes sense. Would this be better handled perhaps in a VB
form?
Thanks for any help you can give.
 
C

carlo

Hi Pam, did you try data validation?? you could use this instead of a
combobox which works almost the same.

go to a cell, choose Data --> Validation --> then List.
there you can enter your selection.

maybe that saves you the hassle of working with VBA.

Cheers

Carlo
 
P

Pam

I tried data validation at first, but my boss didn't like that because they
didn't want the staff to have to click on the drop down list, they wanted
them to be able to start typing and have it auto complete, any ideas?
Thanks
Pam
 
C

carlo

In that case I'd say it would be easiest to make a VBA Userfrom.
I tried to write a procedure to exit the Combobox, but it didn't work.
Maybe somebody else has an Idea.

If there are any questions concerning the Userform, just post it in
the newsgroup. (maybe open a new thread, so more people will look at
it, but don't forget to link to this thread, which is always helpful)

cheers

Carlo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top