View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Greg Wilson Greg Wilson is offline
external usenet poster
 
Posts: 747
Default Not going through all Conditions

If my read is correct then the error is the following two block of code:
' If CB's client can skip, otherwise:
If Not FoundClient Then
End If

For j = LBound(vArr2) To UBound(vArr2)
If rCell.Value = vArr2(j) Then
If .Value = vArr(j) Then
Set sDest = fin2.Worksheets(vArr2(j)).Cells( _
25, 1).End(xlUp).Offset(1, 0)
.EntireRow.Copy Destination:=sDest
FoundClient = True
End If
End If
Next j

Suggested is that you check if substituting the following works. Note the
removal of the inner nested If/End If statement requiring that rCell.Value
simultaneously equal vArr2(j) and vArr(j):

If Not FoundClient Then
' 3) Check for Team MS's client:
For j = LBound(vArr2) To UBound(vArr2)
If .Value = vArr2(j) Then
Set sDest = fin2.Worksheets(vArr2(j)).Cells( _
25, 1).End(xlUp).Offset(1, 0)
.EntireRow.Copy Destination:=sDest
FoundClient = True
End If
Next j
End If

Regards,
Greg