How to use drop down lists in Worksheets using VBA

  • Thread starter Thread starter Deecrypt
  • Start date Start date
D

Deecrypt

Hi all,
I literally have about 4 days of VBA experience so please bear with me.
I'm having problems creating List/Combo boxes using a macro. Devising
a macro which, on execution prompts the user for the location of a
source excel file containing the raw data. This I've done using
Application.GetOpenFilename and it works. Once the file is selected I
need the user to promted by two dialog boxes, one after the other.

1) First dialog box presents the user with a drop down list containing
entries for the 12 months ("January", "February"...."December"). The
Dialog box comes with an OK and Cancel button.

2) Second dialog box presents the user with a drop down list containing
entries for years in the future upto 2010 ("2006", "2007"...."2010").
The Dialog box again comes with an OK and Cancel button.

The macro will then identify which values have been selected,
concatenate these as one string value and populate a Cell (assume Cell
A5) with this value thus making it the title. Finally contents of a
sheet from the source file and copied and pasted to Workbook where the
application is running from.

Please help on how to create such drop down lists as I keep trying to
create a ComboBox the same was as InputBox or MsgBox and that does not
seem to work. Desperately need help.

Thank you kindly
Khurram
 
Hi John,
The code works like a charm. You have opened up a whole new avenue of
things I can do with a macro now. I'll be in touch if I require any
more help (which is more than likely :-)

Cheers
Khurram
 

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

Back
Top