Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DropDown List Return Selected Item using VBA 1

Status
Not open for further replies.

eoaapp

Programmer
Apr 24, 2009
2
GR
I use the following code
>>Sub TESTA()
>>With Worksheets(1)
>>Set k = .Shapes.AddFormControl(xlListBox, 100, 10, 100, 100)
>> For x = 1 To 10
>> k.ControlFormat.AddItem "test" & x
>> Next
>>End With
>>End Sub
wich produce a drop dawn list (test1, test2, ...,test10).

I need help to add code that each time i select a item from the list, the value that i select (e.g "test2") to be copied in cell A1.

many thanks
 
You would need to add a click event for the control in VBA - there are some samples of using code to write code in this forum....

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top