Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing a UDF as an argument to a UDF puff Excel Discussion (Misc queries) 3 February 23rd 06 09:46 PM
Passing argument to another Sub Roman Excel Programming 6 February 1st 05 09:17 PM
?Passing argument/parameter just starting Excel Programming 1 October 23rd 04 04:23 PM
Passing Worksheet tab as an argument. Kashizzz Excel Programming 4 September 2nd 04 08:37 AM
Need help passing an array as an argument blc[_3_] Excel Programming 3 August 4th 04 10:35 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"