Excel Custom Lists?

gmooney

Board Regular
Joined
Oct 21, 2004
Messages
168
I just created a custom list in an Excel file that I am using for a Slicer and pivot table filter.

I emailed the file to another person and the custom list did not transfer with the file?

How can I make sure that the custom list stays in the file?
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Paul Ked

Active Member
Joined
Jun 4, 2015
Messages
442
Don't think you can, directly, because they are stored in the Registry.

You could put it (them) on a separate sheet with instructions to the recipient describing how to add it (them).
 

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
2,780
Office Version
365, 2019, 2016
Platform
Windows
You can add the custom list with VBA on the Workbook_Open event.

Code:
Private Sub Workbook_Open()
On Error Resume Next


For i = 1 To Application.CustomListCount 'Get rid of other custom lists, catch errors for system lists
   Application.DeleteCustomList (i)
Next i


Application.AddCustomList ListArray:=Array("Item 1", "Item 2", "Item 3", "Item 4", "Item 5")
End Sub
 

gmooney

Board Regular
Joined
Oct 21, 2004
Messages
168
You can add the custom list with VBA on the Workbook_Open event.

Code:
Private Sub Workbook_Open()
On Error Resume Next


For i = 1 To Application.CustomListCount 'Get rid of other custom lists, catch errors for system lists
   Application.DeleteCustomList (i)
Next i


Application.AddCustomList ListArray:=Array("Item 1", "Item 2", "Item 3", "Item 4", "Item 5")
End Sub
You can add the custom list with VBA on the Workbook_Open event.

Code:
Private Sub Workbook_Open()
On Error Resume Next


For i = 1 To Application.CustomListCount 'Get rid of other custom lists, catch errors for system lists
   Application.DeleteCustomList (i)
Next i


Application.AddCustomList ListArray:=Array("Item 1", "Item 2", "Item 3", "Item 4", "Item 5")
End Sub
lrobbo314
Thank you! Can I replace the array of Item 1, Item 2, with looking up the values from a range in a sheet of the workbook? If so what would I change that line of code to?
 

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
2,780
Office Version
365, 2019, 2016
Platform
Windows
It would be

VBA Code:
Application.AddCustomList ListArray:=Range("A1:A5")
 

gmooney

Board Regular
Joined
Oct 21, 2004
Messages
168
It would be

VBA Code:
Application.AddCustomList ListArray:=Range("A1:A5")
Irobbo314 does that replace all of the code or just a certain section of it?
 

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
2,780
Office Version
365, 2019, 2016
Platform
Windows
It's just replacing the line below.

Application.AddCustomList ListArray:=Array("Item 1", "Item 2", "Item 3", "Item 4", "Item 5")
 

gmooney

Board Regular
Joined
Oct 21, 2004
Messages
168
irobbo314. Can the sheet be hidden that I want to look the values up?
 

Watch MrExcel Video

Forum statistics

Threads
1,102,826
Messages
5,489,081
Members
407,671
Latest member
annep833

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top