Thread
:
Call a function within Excel VBA --- need help can't figure out syntax correctly
View Single Post
#
4
Posted to microsoft.public.excel.worksheet.functions
GS[_2_]
external usenet poster
Posts: 3,514
Call a function within Excel VBA --- need help can't figure out syntax correctly
on 2/1/2012,
supposed :
On Tue, 31 Jan 2012 17:47:15 -0500, GS wrote:
laid this down on his screen :
I am trying to use the code for sorting worksheets by a named array
from this website
http://www.cpearson.com/excel/SortWS.aspx
Sub SortMySheets()
Dim NameArray As Variant
NameArray = Range("mysheets").Value
'Looping structure to look at array.
For i = 1 To UBound(NameArray)
MsgBox NameArray(i, 1)
Next
SortWorksheetsByNameArray (NameArray()) <== I keep getting errors
here, think i have tried almost everything
End Sub
Where do you store the SortWorksheetsByNameArray() procedure? Is it
scoped 'Private' to a specific module outside the module where you have
this code? More info is needed to better help you...
The SortWorksheetsByNameArray is declared as a Public Function
It is in a different workbook module however.
The error I get is type mismatch.
You may need to ref the VBA project the function is in. It would be
easier if you copy it into a standard module in your project.
Also, post the function's declaration so we can see what it needs for
Type of args being passed in.
--
Garry
Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Reply With Quote
GS[_2_]
View Public Profile
Find all posts by GS[_2_]