John Yazou
New Member
- Joined
- Mar 17, 2002
- Messages
- 49
Hi all...
Whats the correct way to pass paramArray?? When I run test() the first msgbox says 3, the second one says 0. Thanks in advance.
John
eg. my code here
Sub CreateReport(xlBook As Workbook, dataReference As String, ParamArray State() As Variant)
Dim i
xlBook.Worksheets.Add.Name = "MIS" ' Create new sheet
msgbox UBOUND(State)
For i = 1 To 30
==> LINE OF INTEREST WriteTable xlBook.Application.Range("A3").Offset(i * 2, 0), "S" & Format(i, "00"), dataReference, State
Next i
End Sub
Sub WriteTable(objStart As Range, SVCode As String, dataReference As String, ParamArray State() As Variant)
Dim i, db, str1, str2
MsgBox UBound(State)
end sub
sub test()
CreateReport ActiveSheet.Application, "reference", "f26", "m26", "h26"
end sub
Whats the correct way to pass paramArray?? When I run test() the first msgbox says 3, the second one says 0. Thanks in advance.
John
eg. my code here
Sub CreateReport(xlBook As Workbook, dataReference As String, ParamArray State() As Variant)
Dim i
xlBook.Worksheets.Add.Name = "MIS" ' Create new sheet
msgbox UBOUND(State)
For i = 1 To 30
==> LINE OF INTEREST WriteTable xlBook.Application.Range("A3").Offset(i * 2, 0), "S" & Format(i, "00"), dataReference, State
Next i
End Sub
Sub WriteTable(objStart As Range, SVCode As String, dataReference As String, ParamArray State() As Variant)
Dim i, db, str1, str2
MsgBox UBound(State)
end sub
sub test()
CreateReport ActiveSheet.Application, "reference", "f26", "m26", "h26"
end sub