Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete custom lists
On 13 October 2006 Bob Phillips posted below code. I would like very much to
use this code but I cannot get it to work I get the error message: "Compile error Argument not optional", and the text "DeleteCustomList" in the fifth line from below is highlighted. Sub DeleteLists() Dim msg As String Dim aryList Dim i As Long, j As Long For i = 1 To Application.CustomListCount aryList = Application.GetCustomListContents(i) msg = "" For j = LBound(aryList) To UBound(aryList) msg = msg & aryList(j) & vbNewLine Next j If MsgBox(msg & vbNewLine & vbNewLine & "Delete this list?", vbYesNo) = vbYes Then Application.DeleteCustomList Application.GetCustomListNum(aryList) End If Next i End Sub Any help? Hans Knudsen |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete custom lists
These two lines... Application.DeleteCustomList Application.GetCustomListNum(aryList) Should be one line... Application.DeleteCustomList Application.GetCustomListNum(aryList) -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "Hans Knudsen" wrote in message On 13 October 2006 Bob Phillips posted below code. I would like very much to use this code but I cannot get it to work I get the error message: "Compile error Argument not optional", and the text "DeleteCustomList" in the fifth line from below is highlighted. Sub DeleteLists() Dim msg As String Dim aryList Dim i As Long, j As Long For i = 1 To Application.CustomListCount aryList = Application.GetCustomListContents(i) msg = "" For j = LBound(aryList) To UBound(aryList) msg = msg & aryList(j) & vbNewLine Next j If MsgBox(msg & vbNewLine & vbNewLine & "Delete this list?", vbYesNo) = vbYes Then Application.DeleteCustomList Application.GetCustomListNum(aryList) End If Next i End Sub Any help? Hans Knudsen |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete custom lists
Thank you.
Jim Cone wrote: These two lines... Application.DeleteCustomList Application.GetCustomListNum(aryList) Should be one line... Application.DeleteCustomList Application.GetCustomListNum(aryList) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Re-Using Custom Lists | Excel Discussion (Misc queries) | |||
custom lists and custom formulas? | Excel Discussion (Misc queries) | |||
How do I delete custom lists | Excel Discussion (Misc queries) | |||
Custom lists (XP) | Excel Discussion (Misc queries) | |||
Custom Lists | Excel Discussion (Misc queries) |