PC Review


Reply
Thread Tools Rate Thread

Delete custom lists

 
 
Hans Knudsen
Guest
Posts: n/a
 
      16th Dec 2007
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




 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      16th Dec 2007

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"
<(E-Mail Removed)>
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




 
Reply With Quote
 
Hans Knudsen
Guest
Posts: n/a
 
      16th Dec 2007
Thank you.


Jim Cone wrote:
> These two lines...
> Application.DeleteCustomList
> Application.GetCustomListNum(aryList)
>
> Should be one line...
> Application.DeleteCustomList Application.GetCustomListNum(aryList)



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom lists and custom formulas? nameruc Microsoft Excel Misc 0 6th Dec 2006 04:18 PM
How do I delete custom lists =?Utf-8?B?VGVycnlfRGVsbA==?= Microsoft Excel Misc 3 16th Oct 2006 09:29 PM
Custom Lists =?Utf-8?B?TmF0YXNoYQ==?= Microsoft Excel Misc 3 26th Apr 2006 04:17 PM
Custom Lists =?Utf-8?B?RGViYmll?= Microsoft Excel Misc 1 19th Aug 2005 04:07 PM
HOW DO I USE A CUSTOM LISTS =?Utf-8?B?YmFycnk=?= Microsoft Excel New Users 1 29th Dec 2004 06:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:21 PM.