Using a ComboBox for Data Entry into a Cell

  • Thread starter Thread starter Jon Turner
  • Start date Start date
J

Jon Turner

I have a comboBox control. Any time the user sets focus to a cell in column
L, I
want to move the comboBox over to that cell, have the comboBox selected on
the
value of that cell. Thus using the combo box for the cell's data entry.
Can someone
provide me with an example of this ?

1. I don't want to use the DropDown List, because you can't control the
font.
2. I don't want to copy and paste a combo box for each cell because if the
user
adds a row, the comboBox doesn't come along with it.

Many Thanks
 
This will move the combobox to the selected cell - it is an event procedure
so needs to be in the worksheet's code module (in the VBA Project Explorer
make sure the worksheet is selected):

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not ((Intersect(Target, Range("L:L")) Is Nothing) And (Intersect(Target,
Range("I:I")) Is Nothing)) Then

ComboBox1.Top = Target.Top
ComboBox1.Left = Target.Left
Combobox1.Value = Target.Value

End If

End Sub


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

Similar Threads

Combobox filtering 2
Iterating through a ComboBox's values 6
Combobox release 4
Combobox Rowsource 2
ComboBox Dropdown not under control 1
combobox 1
MSForms 2.0 Combobox problem 1
Create List for ComboBoxes 4

Back
Top