October 14th, 2002, 7:06 am
Looks like a VB bug, though I suspect you worked that out yourself The ' X to Y' syntex is sticky, thus we need to cast it away it a different stack frame.I've written a tiny routine, which should do the job.See below, which works in VB6 and VBA in Excel 2000.At the risk of sounding too much like a CompSci graduate, you seem to be doing ragged arrays.There are a variety of other alternatives which may make for better code.Private Sub DomExample()Dim i As IntegerDim FirstOne()ReDim Preserve FirstOne(1 To 10)For i = 1 To 10 FirstOne(i) = iNext iReCast FirstOne, 2, 11For i = 2 To 11 FirstOne(i) = iNext iEnd SubSub ReCast(v As Variant, lower As Long, upper As Long)ReDim Preserve v(lower To upper)End Sub