Hello,
I have a distributable workbook that utilizes custom sort lists. I would like to include a macro in the file that (when someone else opens the file) automatically runs and imports the custom lists.
I have a macro that adds the lists but the issue is on repeated use. Currently, if the user already has a custom list like the one trying to be imported, an error occurs. I would like to delete that list before importing the new one (or skip the import). Any tips would be greatly appreciated, thanks!
Here is what I have:
Sub Customlistadd()
'
' Customlistadd Macro
'
'
Application.AddCustomList ListArray:=Range("'Custom Sort'!A2:A31")
Application.AddCustomList ListArray:=Range("'Custom Sort'!C2:C33")
Application.AddCustomList ListArray:=Range("'Custom Sort'!E2:E8")
Application.AddCustomList ListArray:=Range("'Custom Sort'!G2:G5")
End Sub
I have a distributable workbook that utilizes custom sort lists. I would like to include a macro in the file that (when someone else opens the file) automatically runs and imports the custom lists.
I have a macro that adds the lists but the issue is on repeated use. Currently, if the user already has a custom list like the one trying to be imported, an error occurs. I would like to delete that list before importing the new one (or skip the import). Any tips would be greatly appreciated, thanks!
Here is what I have:
Sub Customlistadd()
'
' Customlistadd Macro
'
'
Application.AddCustomList ListArray:=Range("'Custom Sort'!A2:A31")
Application.AddCustomList ListArray:=Range("'Custom Sort'!C2:C33")
Application.AddCustomList ListArray:=Range("'Custom Sort'!E2:E8")
Application.AddCustomList ListArray:=Range("'Custom Sort'!G2:G5")
End Sub