The aim of my code is to print available if there is any data betweeen L1 to W1000 of length 7.
Although it finds the value of length 7, my code doesn't obey exit for.
what is the reason?
Private Sub CommandButton1_Click()
Dim Prod As Variant
Dim Dev As Variant
Dim counter As Integer
Dim j As Variant
Prod = Array("PBA_100", "PCA_500", "PRD_500", "PGA_500", "PVD_500")
For j = LBound(Prod) To UBound(Prod)
MsgBox Prod(j)
With ThisWorkbook.Sheets(Prod(j))
LastRow = ThisWorkbook.Sheets(Prod(j)).Columns("A").Cells.Find("*",
SearchOrder:=xlByRows, LookIn:=xlValues, SearchDirection:=xlPrevious).Row
For Each cell In .Range("N2:N" & LastRow)
arr = Split(Replace(cell.Value, " ", " "), " ")
For Each arrElem In arr
If Len(arrElem) = 7 Then
MsgBox arrElem
Exit For
Else
MsgBox arrElem
End If
Next arrElem
Next cell
End With
Next j
End Sub
kis defined?