Hi all, hopefully someone can help with this pls. I have searched google but nothing works for me.
I have one procedure that contains an array:
Sub OpenSheets()
'Create array of sheets to check
Dim SheetsToOpen(0 To 3) As String
SheetsToOpen(0) = "Clean Summary 09.xls"
SheetsToOpen(1) = "Heat Summary 09.xls"
SheetsToOpen(2) = "Lift Summary 09.xls"
SheetsToOpen(3) = "Livery Summary 09.xls"
..more code, more code etc..
CheckSheets(SheetsToOpen)
End Sub
So without having to create this array again which will be needed in my next procedure, I would like to pass it along to it. Here is my code:
Sub CheckSheets(SheetsToOpen() As String)
'Loop through all values in array
For x = 0 to 3
MsgBox SheetsToOpen(x)
Next
End Sub
but I get the error: Type mismatch: array or userdefined type expected
this error occurs on this row
PullDataFromSpreadsheets (SheetsToOpen)
Does anyone have an idea why I can't pass the array?
Its not actually that big a deal (I can just create another one) but I would like to know for future pls.
Thanks
John
Bookmarks