|
-
Nov 1st, 2013, 10:32 AM
#1
Thread Starter
Member
[RESOLVED] nested For loop not working
I get an error message ' Next Without For' at the bottom of the second loop, and I have no idea why:-
For L = LBound(BArr4) To UBound(BArr4) 'For every line
TmpArr4() = Split(BArr4(L), " ") 'Split into words
For M = LBound(TmpArr4) To UBound(TmpArr4)
Tmp4 = TmpArr4(M)
A_Is = Left(Tmp4, 1)
Select Case A_Is
Case "A": Ac_1 = R
Case "X": Xc_1 = R
Case "T": Tmp4 = Tc_R
End Select
TmpArr4(M) = Tmp4
Next M
BArr4(L) = Join(TmpArr4, " ") 'Join words back into lines
If T_Value = "" Then T_Value = 12
If Ac_1 + Xc_1 >= T_Value Then
BArr4(L - 1) = Replace(BArr4(L - 1), Ac_1 & Xc_1, Tc_R)
TmpArr5(L) = Split(BArr4(L), "A")
TmpArr5(0) = XBlah
BArr4(L) = XBlah & "A" & Ac_1 & Xc_1 & vbNewLine & "A" & Tc_R
Next L
I get the error message even when I comment out all the code between "Next M" and "Next L", Which I can't understand. Any ideas?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|