Help With Simple Combobox Programming

M

MAB

I have a combo box on sheet1. When the user clicks on the combo box the
first time ( it gets focus ) It should add/load all items from sheet2 column
A. Now when the user selects from the combobox that item should be
copied/placed on sheet1.A5 similarly the next item selected in the combo box
should be placed below A6 and so on

How can this be accomplished with code

thx
 
J

Jean-Paul Viel

Hi,



Use code like that :





Private Sub cboIn_Click()

Dim intR As Integer

intR = Range("a4").CurrentRegion.Rows.Count

Range("a4").Offset(intR, 0).Value = cboIn.Value

End Sub



Private Sub cboIn_GotFocus()

Dim rg As Range

cboIn.Clear

For Each rg In Worksheets("sheet4").Range("a1").CurrentRegion

cboIn.AddItem rg.Text

Next rg

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

Top