Replacing an inputbox with a listbox in VBA

September 28, 2013 at 22:32:29
Specs: Windows 7
Hi there,

I am wondering if there is any simple way of replacing the following line of code:

Cells(newRow, 16) = InputBox("Please enter data")

with a listbox so that the user will choose data from a range of cells located on the worksheet, instead of manually typing data in?

See More: Replacing an inputbox with a listbox in VBA

September 29, 2013 at 06:21:35
If you DAGS on VBA create data validation list you'll get lots of hits and examples that can be adapted to fit your exact situation.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

message edited by DerbyDad03

Report •

October 16, 2013 at 04:53:56
this is pretty straight forward

You will have a listbox (Listbox1)

Cells(newRow, 16).value = ListBox1.List(ListBox1.ListIndex)

You can also use

Cells(newRow, 16).value = ListBox1.text)

They both work and will change the value of cell to the value selected in your Listbox1

Report •
Related Solutions

Ask Question