Dropdown list in VBA InputBox

TimvMechelen

Board Regular
Joined
Nov 7, 2016
Messages
120
Hi,

Is it possible to get a dropdown list with VBA InputBox?

The dropdown list has to refer to the table[column]: "TabelMatriaalinformatie[Materiaal:]"

Thank you for you time.

A part of the VBA code i have now:
Code:
Dim Materials As Variant

Sheets("Beginblad").Select
Materials = Inputbox("Material:" , "Algemene gegevens product",Range("D13"))
Range("D13").Value = Materials

Now you can put in something manualy.
Can this be a dropdown list?
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,216
Office Version
  1. 365
Platform
  1. Windows
Sorry it's not possible with a built-in InputBox.:eek:

However it would be straightforward to create your own 'inputbox' with a dropdown using a userform.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,216
Office Version
  1. 365
Platform
  1. Windows
You could create a userform with a droddown to mimic an inputbox.
 

TimvMechelen

Board Regular
Joined
Nov 7, 2016
Messages
120

ADVERTISEMENT

You could create a userform with a droddown to mimic an inputbox.

How can i do this?
A dropdown is not necessary, but something sigmilar where i can choose my materials from a list is fine too.


Something like this maybe?
populate_userform_list_10.png
 
Last edited:

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,216
Office Version
  1. 365
Platform
  1. Windows
Open the VBE (ALT+F11), goto Insert>Userform...

You should now have a blank userform that you can add comboboxes, listboxes, buttons etc.

If you don't want to use a userform you could set up an in-cell dropdown in D13, or any other cell, using Data>Validation... with the List option.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,303
Messages
5,595,324
Members
413,986
Latest member
Elizsk

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top