Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Dear all, I want to call other sub in the same module. Here are my codes. Can yo help me point out the problem? Thanks. Dim LibraryList(20) As String 'I want to use LibraryList(20) as global array Sub CreateLibraryArray() Y = 0 For X = 1 To Worksheets.Count If InStr(Sheets(X).Name, "Library") 0 Then LibraryList(Y) = Sheet(X).Name Y = Y + 1 End If Next X End Sub Sub NewSub() Dim List1(20) As String CreateLibraryArray() 'Can I call CreateLibraryArray( here? List1(10) = LibraryList(10) .... End Sub Thanks. Davi -- yangy ----------------------------------------------------------------------- yangyh's Profile: http://www.excelforum.com/member.php...fo&userid=2688 View this thread: http://www.excelforum.com/showthread.php?threadid=46657 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi David,
Your code worked for me with the following: Change: CreateLibraryArray() to: CreateLibraryArray Also, change: LibraryList(Y) = Sheet(X).Name to: LibraryList(Y) = Sheets(X).Name --- Regards, Norman "yangyh" wrote in message ... Dear all, I want to call other sub in the same module. Here are my codes. Can you help me point out the problem? Thanks. Dim LibraryList(20) As String 'I want to use LibraryList(20) as a global array Sub CreateLibraryArray() Y = 0 For X = 1 To Worksheets.Count If InStr(Sheets(X).Name, "Library") 0 Then LibraryList(Y) = Sheet(X).Name Y = Y + 1 End If Next X End Sub Sub NewSub() Dim List1(20) As String CreateLibraryArray() 'Can I call CreateLibraryArray() here? List1(10) = LibraryList(10) ... End Sub Thanks. David -- yangyh ------------------------------------------------------------------------ yangyh's Profile: http://www.excelforum.com/member.php...o&userid=26883 View this thread: http://www.excelforum.com/showthread...hreadid=466575 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro in excel to call a access module to run. | Excel Discussion (Misc queries) | |||
to call procedure in a worksheet in a module | Excel Discussion (Misc queries) | |||
how to call Access's function in different module in Excel VBA | Excel Programming | |||
how to call Access function&module in Excel VBA?? | Excel Programming | |||
Call Private Function from ThisWorkbook module | Excel Programming |