Combo Box Control

  • Thread starter Thread starter Brad
  • Start date Start date
B

Brad

Thanks for taking the time to read my question.

I have a combo box that the user can choose values from.
Once the user has chosen a value I would like to move the
focus to a cell on the same worksheet. How do you do
this?

I've tried everything I know. I've looked in help
extensivly.

The combo box name is ComboBox5

Thanks so much,

Brad
 
The name doesn't matter, just select the cell.

Range("B3").Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thanks for taking the time to read my question.

I have a combo box that the user can choose values from.
Once the user has chosen a value I would like to move the
focus to a cell on the same worksheet. How do you do
this?

I've tried everything I know. I've looked in help
extensivly.

The combo box name is ComboBox5

Thanks so much,

Brad


You could try something like

Private Sub ComboBox5_Change()
ActiveSheet.Cells(3, 4).Select
End Sub

change the 3 and the 4 to your specific needs.

Hope this helps.

Lars-Åke
 
Thanks,

I understand that part, but how do you move the focus
from the combo box to the worksheet, AFTER the combo box
item has been chosen?

Brad
 
The problem with this idea is that the _Change event
fires when the combo box gets the focus.

Brad
 
Here is the solution that I figured out.

I placed a public variable in my Module and referred to
it in these to procedures.

Brad

Public HasentGoFocusYet as Boolean '(This is in the
Module)

'These are in the worksheet code page

Private Sub ComboBox5_Change()
If HasentGoFocusYet = True Then
Cells(ActiveCell.Row, ActiveCell.Column -
1).Select
HasentGoFocusYet = False
End If
End Sub

Private Sub ComboBox5_GotFocus()
HasentGoFocusYet = True
Sheets("Flock Sheet").ComboBox5.DropDown
End Sub
 

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

Back
Top