How to open a cell automatic drop-down menu when typing in Excel

Source: Internet
Author: User

When we need to enter a large amount of duplicate data in an Excel table, we often use the validity of the data to make a drop-down menu to increase the input speed of duplicate data. However, in the actual operation, you must select a cell that needs to enter duplicate data and click the Drop-down arrow to the right of the cell to see the Drop-down menu of the data validation that you have customized beforehand. Can you implement a Drop-down menu that automatically expands data validation when you select an Excel cell to make the input of duplicate data a step faster? The answer is certainly yes. Next. I will give you an introduction to how to achieve.

To implement the Drop-down menu step:

Start Excel 2003 and open a workbook that has a set data validation drop-down menu (such as payroll. xls), and then click the menu tools → macros →visual Basic Editor command to bring up the visual Basic Editor, and then in the visual Basic Editor window, double-click the Sheet1 (*) option in the Engineering-vbaproject panel (* For a worksheet that currently requires quick input of duplicate data), enter the following code in the pop-up code window:

Option Explicit

Private Sub Worksheet_selectionchange (ByVal Target as Range)

If target.column = 3 Then application.sendkeys "%{down}"

If target.column = 4 Then application.sendkeys "%{down}"

End Sub

When you have finished entering the code, close the Visual Basic Editor window, and the code we enter will be saved automatically.

Tip: The meaning of the code is that when we select any cell in column 3rd, column 4th (that is, columns C and D), the Drop-down menu for data validation will be automatically expanded. In the actual operation process, we can flexibly modify these two natural numbers to meet their needs.

When you are done, close the payroll. XLS and save the changes you made to it. Then reopen it, and then select any cell in column C or D (such as the D11 cell in the figure), and you can see the Drop-down menu for the data validation that the column cell automatically expands, as shown in Figure A. So we can enter those duplicate data to be quicker than the original one step. Friends with this need may wish to try.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.