Drop Down List Box and VB Coding

T

Todd

I have coding so that when data is entered in cell A1, the
date the data was entered will appear in cell B1. I would
like to add a drop down list box to A1 and also have the
same outcome when a selection in the box is selected. I
tried linking the outcome of the listbox to cell A1, but
it did not seem to work. Does anyone have any
suggestions? Anything will help. Thanks!

Todd
 
D

Dave Peterson

Debra verified that in xl97 the event is triggered if the list is embedded in
the DV. But won't fire if the list is a range on a worksheet.
 
I

insearchuvu

To Enter data in a cell from a list you specify

You can create a dropdown list that gets its choices from cells
elsewhere on the worksheet.
1. Type the entries for the dropdown list in a single column or row.
Do not include blank cells in the list.
or, If you type the list on a different worksheet from the data entry
cell, define a name for the list.

How?
1. Select the cell, range of cells, or nonadjacent selections that you
want to name.
2. Click the Name box at the left end of the formula bar .
Name box
3. Type the name for the cells.
4. Press ENTER.

Note You cannot name a cell while you are changing the contents of
the cell. If you type the list in a different workbook, define a name
with an external reference to the list.

How?
5. Open the workbook that contains the list of dropdown entries.
6. Open the workbook where you want to validate cells, point to Name
on the Insert menu, and then click Define.
7. In the Names in workbook box, type the name.
8. In the Refers to box, delete the contents, and keep the insertion
pointer in the box.
9. On the Window menu, click the name of the workbook that contains
the list of dropdown entries, and then click the worksheet that
contains the list.
10. Select the cells containing the list.
11. In the Define Name dialog box, click Add, and then click Close.
12. Select the cell where you want the dropdown list.
13. On the Data menu, click Validation, and then click the Settings
tab.
14. In the Allow box, click List.
15. If the list is in the same worksheet, enter a reference to your
list in the Source box.

If the list is elsewhere, enter the name you defined for your list in
the Source box.

Make sure the reference or name is preceded with an equal sign (=).

16. Make sure the In-cell dropdown check box is selected.
17. Specify whether the cell can be left blank: Select or clear the
Ignore blank check box.
18. To display optional input instructions when the cell is clicked,
click the Input Message tab, make sure the Show input message when cell
is selected check box is selected, and then fill in the title and text
for the message.
19. Specify how you want Microsoft Excel to respond when invalid data
is entered.

How?
20. Click the Error Alert tab, and make sure the Show error alert
after invalid data is entered check box is selected.
21. Select one of the following options for the Style box:

To display an information message that does not prevent entry of
invalid data, click Information.
To display a warning message that does not prevent entry of invalid
data, click Warning.
To prevent entry of invalid data, click Stop.

22. Fill in the title and text for the message (up to 225
characters).

Note: If you don't enter a title or text, the title defaults to
"Microsoft Excel" and the message to: "The value you entered is not
valid. A user has restricted values that can be entered into this
cell."

Note: Applying data validation to a cell does not format the cell.

Tip:
If the entry list is short, you can type the entries directly in the
Source box, separated by the Microsoft Windows list separator character
(commas by default). For example, you could type Low, Average, High
in the Source box instead of entering the three words on a worksheet.
 

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

Top