Reputation: 5044
Is it possible to have a macro that, when pressed, pops up a message box asking for a string of text, and then a drop down that has a list of categories?
All I would need it to do is take this information and save it into a cell. If so, how?
Upvotes: 0
Views: 20581
Reputation: 10381
[I'm going based on Excel 2007 here, but if you're using 2003, you'll have to navigate the menu structure]
Go to the VBE (by going to the View
tab, then click on Macro
- creating or editing an existing one will take you there - or click Alt+F11).
Go to the Insert
menu, and select Userform
. Drag a textbox (the ab|
icon), and a combobox onto your form. To set the textbox value to a cell when you change the combobox, create a subroutine in the code to do this by double clicking on the combobox.
Set the combobox items by using the .additem
method of comboBox1
in your code. These can be delineated or grabbed from a range in your code (see here)
Within that subroutine, set the value of whatever cell you want to textbox1.Text
, which is the contents of the textbox.
Upvotes: 1