InputBox Drop Down List?

A

Astello

I'm wondering if you can have a drop down list in an InputBox, or if
there is something similar to an InputBox for this function. I am
running a macro in Excel where I want the user to be able to choose a
city from a drop down list, and then have whatever city they choose
choose put an associated zip code into the spreadsheet. Is this
possible?
 
D

Dave Peterson

Not using an inputbox, but you could design a userform with a combobox that
offers the cities you want to support. You could use =vlookup() in your code or
just plop the results of the combobox into a worksheet cell and use =vlookup()
in an adjacent cell.

This is from Debra Dalgleish's site:
http://contextures.com/xlUserForm01.html

Tom Ogilvy posted these links:
Peter Aiken Articles:
Part I
http://msdn.microsoft.com/library/en-us/dnoffpro01/html/IntroductiontoUserFormsPartI.asp
Part II
http://msdn.microsoft.com/library/en-us/dnoffsol02/html/IntroductiontoUserFormsPartII.asp

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
A

Astello

Forgive me for being naive, but how do I "plop" the values from the
combobox into a worksheet? That's what I'm having trouble defining at
this point.
 
D

Dave Peterson

Debra's site shows one way to do it.
Forgive me for being naive, but how do I "plop" the values from the
combobox into a worksheet? That's what I'm having trouble defining at
this point.
 

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


Top