View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default How to reference a public array (declared in module) from a proced

Assuming arrayname is a single dimension array of type string.

Public Sub setSelections(arrayName as String)
for i = lbound(arrayname) to ubound(arrayname)
sStr = msg & arrayname(i) & ", "
if i mod 5 = 0 then
msgbox msg
sStr = ""
end if
Next
end sub

--
Regards,
Tom Ogilvy


"Amzee" wrote in message
...
I can reference a listbox in a Worksheet using the following

Public Sub Procedure1(worksheetName As String, listBoxName As String)
Dim listSize As Integer
listSize =

Worksheets(worksheetName).OLEObjects(listBoxName). Object.ListCount
.....
end sub

How do I do the same for a public array (declared in a module) with the
following procedure??

Public Sub setSelections(arrayName as String)
????.....
end sub

Thanks!