Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
passing argument problem ??
Using the following code: Sub StartPPTOptions() Call BuildListbox(PPTOptions.Name, _ PPTOptions.ClientPPTListbox.Name, _ "ClientMain1") End Sub Sub BuildListbox(lbForm, lbName, lbSource) Dim AllCells As Range, Cell As Range Dim NoDupes As New Collection Dim Item lbForm.lbName.Clear Set AllCells = Range(lbSource) On Error Resume Next For Each Cell In AllCells NoDupes.Add Cell.Value, CStr(Cell.Value) Next Cell On Error GoTo 0 For Each Item In NoDupes lbForm.lbName.AddItem Item Next Item End Sub I am trying to use one sub to build quite a few listboxes by passing the needed arguments. When it hits the lbform.lbname.Clear I get an "Object required" error. Thanks. -- ricksimm ------------------------------------------------------------------------ ricksimm's Profile: http://www.excelforum.com/member.php...o&userid=21892 View this thread: http://www.excelforum.com/showthread...hreadid=378708 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
passing argument problem ??
Sorry, but what exactly are you trying to accomplish? And where do you build
the ListBox? Not sure what: lbForm.lbName.Clear is supposed to accomplish. It appears that lbForm and lbName are strings (even though you have not declared data types). -- Vasant |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Passing a UDF as an argument to a UDF | Excel Discussion (Misc queries) | |||
Passing argument to another Sub | Excel Programming | |||
?Passing argument/parameter | Excel Programming | |||
Passing Worksheet tab as an argument. | Excel Programming | |||
Need help passing an array as an argument | Excel Programming |