Combo Box Control

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
 
B

Bob Phillips

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)
 
L

Lars-Åke Aspelin

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
 
G

Guest

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
 
B

Brad

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

Brad
 
G

Guest

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
 
Top