T
tkpmep
Friends,
I'm having trouble passing a range from one subroutine to another, and
I'd appreciate some help with my problem. In the main routine I write
Set Portfolio = ActiveWorkbook.Worksheets("Hedging").Range("C2",
Range("C2").End(xlDown))
I then call the subroutine fillIndex as follows:
Call fillIndex(Portfolio, "IG", IGCol, NIG, NIGInPort, lastRow, IG)
IGCol, NIG and NIGinPort are integers and IG is an array of length
NIG.
fillIndex is defined in the same module as follows:
Sub fillIndex(Portfolio As Range, CDXIndexName As String, Col As Long,
NHold As Long, IndexHoldingsinPort As Long, lastRow As Long,
Holdings() As Variant)
..
end sub
But when I try to execute it, the parameter NIG is consistently
highighted, and the following error message appears: ByRef Argument
type mismatch. What am I doing wrong, and how can I fix it?
Thanks in advance
Thomas Philips
I'm having trouble passing a range from one subroutine to another, and
I'd appreciate some help with my problem. In the main routine I write
Set Portfolio = ActiveWorkbook.Worksheets("Hedging").Range("C2",
Range("C2").End(xlDown))
I then call the subroutine fillIndex as follows:
Call fillIndex(Portfolio, "IG", IGCol, NIG, NIGInPort, lastRow, IG)
IGCol, NIG and NIGinPort are integers and IG is an array of length
NIG.
fillIndex is defined in the same module as follows:
Sub fillIndex(Portfolio As Range, CDXIndexName As String, Col As Long,
NHold As Long, IndexHoldingsinPort As Long, lastRow As Long,
Holdings() As Variant)
..
end sub
But when I try to execute it, the parameter NIG is consistently
highighted, and the following error message appears: ByRef Argument
type mismatch. What am I doing wrong, and how can I fix it?
Thanks in advance
Thomas Philips