View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
crazybass2 crazybass2 is offline
external usenet poster
 
Posts: 167
Default From cell/combo to combo/cell

Lluis,

Place the following code in the sheet module. You will need to change the
"ComboBox1/ComboBox2" references in the code to match the name of your combo
boxes. Play around with the 'Activate' and 'DropDown' methods for the
desired effect (ie. delete 'ComboBox1.Activate:' and ': ComboBox2.DropDown'
to see what changes).

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C5")) Is Nothing Then ComboBox1.Activate:
ComboBox1.DropDown
If Not Intersect(Target, Range("C8")) Is Nothing Then ComboBox2.Activate:
ComboBox2.DropDown
End Sub
Private Sub ComboBox1_Change()
Range("C8").Select
End Sub
Private Sub ComboBox2_Change()
Range("C11").Select
End Sub


Mike

"Lluis Escude" wrote:

After I've typed data + return key to a specific cell, say C5, I want the
focus to be automatically transferred to a combobox in the same worksheet.
What code do I need and where -in what event handler- must it be placed?
Then, after I've selected one of the combo items (and maybe -maybe not- hit
the return key as well) I want the focus to be automatically set to some
other cell, such as C8. Same question as above.

The idea is to cycle through a number of cells and comboboxes so that no
cells can be selected/activated that don't require input data.