Excel Custom Lists?

gmooney

Active Member
Joined
Oct 21, 2004
Messages
254
Office Version
  1. 365
Platform
  1. Windows
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?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
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).
 
Upvote 0
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
 
Upvote 0
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?
 
Upvote 0
It would be

VBA Code:
Application.AddCustomList ListArray:=Range("A1:A5")
 
Upvote 0
It's just replacing the line below.

Application.AddCustomList ListArray:=Array("Item 1", "Item 2", "Item 3", "Item 4", "Item 5")
 
Upvote 0
irobbo314. Can the sheet be hidden that I want to look the values up?
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,118
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top