Options¦Custom Lists

Home Search Site Map

Up
Options¦Calculation
Options¦Chart
Options¦Color
Options¦Custom Lists
Options¦Edit
Options¦Error Checking
Options¦General
Options¦International
Options¦Save
Options¦Security
Options¦Spelling
Options¦Transitions
Options¦View

New! Excel User Group Now Open @ www.excelusergroup.org,

UK EXCEL USER CONFERENCE - LONDON, UK. APRIL 1st/2nd 2009 - TOTALLY FREE - DETAILS CAN BE CHECKED OUT HERE! Check It Out!


Menu command Type What happens next?
Custom Lists Tab

Excel can be set to automatically fill 'lists' it recognises, for example, if you type Jan in cell A1 and drag the 'fill handle' (small square in bottom right of active cell) across twelve columns, you will get Jan, Feb, Mar, Apr.....etc. This is controlled from here.

Custom lists can be useful if you are always typing repetitive information, perhaps as row and/or column headers.

You can see in the dialog above, I have set up a three item list, (Test1 to 3).  Now if I enter Test1 in a cell and drag the fill handle down, it will fill in the others automatically. If I drag past three cells, it will start at Test1 again.

Lists can be added manually, by typing the entries, each on one line, in the 'list entries' box and pressing 'Add'. You can also type them on a worksheet and import it by clicking in the 'Import list from cells:' box, select the data and clicking 'Import'.

Any lists no longer being used can be selected under 'Custom lists' and click the 'delete' button

VBA Sub ShowCustomListsOnSheet()
Dim wks As Worksheet
Dim lListCount As Long, x As Long, y As Long
Dim vList As Variant
'Adds new sheet for entries
Set wks = ActiveWorkbook.Worksheets.Add
wks.Name = "Custom Lists"
'gets the number of custom lists (inc Built-in)
lListCount = Application.CustomListCount
For x = 1 To lListCount
'Loads lists into array variable
vList = Application.GetCustomListContents(x)
wks.Range("A" & x).Value = "List " & x & "="
'iterates array and places into columns
For y = 1 To UBound(vList)
wks.Range("A" & x).Offset(0, y).Value = vList(y)
Next y
Next x
'sizes columns to fit
wks.Columns.AutoFit
End Sub

Sub AddCustomList()
Dim vList As Variant
vList = Array("Test1", "Test2", "Test3", "Test4", "Test5")
Application.AddCustomList (vList)
End Sub

Top

Copyright Nick Hodge 2008. All Rights Reserved.