
To see the sample data and letter heading macros from this page, get the Letter Headings in Drop Down List. If Left(c.Offset(1, 0).Value, 1) c.Value Then For unused letters, a data validation error message will appear
With this option, only the used letters can be typed in the drop down list. This macro removes old headings, then adds all 26 letters, removes the unused letters, and sorts the list. You can run this macro with the Sort and Add Used Letters button on the List sheet. It only add a letter if at least one product name begins with that letter. This macro, named InsertLettersUsed, adds letter headings in the named range, MyList, on the List sheet. Next, the macro counts the cells in the data rows of the named table, tblProducts. First, this macro runs the RemoveLetters macro, to remove old headings, if any exist. With this option, any letter can be typed in the drop down list, without an error message. This macro removes old headings, then adds all 26 letters, and sorts the list. You can run this macro with the Sort and Add All Letters button on the List sheet. This macro, named InsertLettersAll, adds all 26 letters as headings in the named range, MyList, on the List sheet. Set myList = wsL.ListObjects("tblProducts") Then, starting from the bottom of the list, it deletes rows that contain a single-character item. The macro counts the cells in the data rows of the named table, tblProducts. To use this macro in your own workbook, change the sheet name and table name in the code. This macro also runs automatically at the beginning of the mactos that add the letter headings. You can run this macro on its own, with the Remove Single Letters button on the List sheet. This macro, named RemoveLetters, removes all single-character items in the named range, MyList, on the List sheet. To see how to make a drop down list in a cell, watch the steps in this short video, and the written instructions There are written steps on the Excel Tables page. To see how to set up a named Excel table, watch this short video.
The MyList named range is the source for these drop down lists. Each cell in the table has a data validation drop down list, where you can select a product name. On the Data Entry sheet, there is an Excel table named tblData. That named range is used as the source for the drop down list on the Data Entry sheet. The data rows are a named range - MyList. On the List sheet, there is an Excel table named tblProducts, with list of product names, sorted A-Z. Data Entry - has a small Excel table for selecting product names.
List - has an Excel table with product names. In the sample workbook, there are 2 main sheets:
Or, use one of the Add Letter Heading macros shown below, to automatically add the headings.No macros are needed to use the drop down list with letter headings.
The list opens at the letter you typed, so you can quickly find the item you need.Type a single letter in the cell, then click the drop down arrow.That might cause problems in some workbooks NOTE: People will be able to select the single letter headings in the drop down list, as well as the other items. This short video shows the steps, and there are written steps below the video. For data validation drop downs with a long list of items, add letter headings, to make navigation easier.