Terry_Orange
Board Regular
- Joined
- Jul 22, 2002
- Messages
- 133
Hi,
In a loop if I call a sub-routine it only finds the first value, then no more. If I remove the sub-routine call, then it finds all of the values. Can anyone help ?
Thank you for any help you can give me !
Nick.
--------------------
Loop:
For j = 0 To 7
If Selection.Offset(j, 0).Value2 = sorted_array_Of_Row_Names(I) Then
MsgBox (j)
add_row_to_arrays j, CounterD
CounterD = CounterD + 1
End If
Next j
-------------------
--------------------
SUB:
Sub add_row_to_arrays(ByVal row_number As Integer, ByVal no_rows As Integer)
Range("C2").Select
ReDim array1(no_rows)
array1(no_rows) = Selection.Offset(row_number, 0).Value2
MsgBox (array1(no_rows) & " " & no_rows)
End Sub
---------------------
In a loop if I call a sub-routine it only finds the first value, then no more. If I remove the sub-routine call, then it finds all of the values. Can anyone help ?
Thank you for any help you can give me !
Nick.
--------------------
Loop:
For j = 0 To 7
If Selection.Offset(j, 0).Value2 = sorted_array_Of_Row_Names(I) Then
MsgBox (j)
add_row_to_arrays j, CounterD
CounterD = CounterD + 1
End If
Next j
-------------------
--------------------
SUB:
Sub add_row_to_arrays(ByVal row_number As Integer, ByVal no_rows As Integer)
Range("C2").Select
ReDim array1(no_rows)
array1(no_rows) = Selection.Offset(row_number, 0).Value2
MsgBox (array1(no_rows) & " " & no_rows)
End Sub
---------------------