I have a macro ruining on range A2:V7500, looking for two conditional Names" "OES" and "James" and copy data to new tab
If names "OES" or "James" are UPPER case letter, then does not count. Any suggestions please.
--------------
Sub test3()
Dim outarr()
inarr = Range("A1:V7500")
ReDim outarr(1 To 7500, 1 To 22)
indi = 1
For i = 2 To 7500
If inarr(i, 10) = "OES" And inarr(i, 20) = "James" And inarr(i, 22) <= 12 Then
' copy row
For j = 1 To 22
outarr(indi, j) = inarr(i, j)
Next j
indi = indi + 1
End If
Next i
Worksheets.Add
ActiveSheet.Name = "James"
If indi > 1 Then
Range(Cells(1, 1), Cells(indi - 1, 22)) = outarr
End If
End Sub
------
If names "OES" or "James" are UPPER case letter, then does not count. Any suggestions please.
--------------
Sub test3()
Dim outarr()
inarr = Range("A1:V7500")
ReDim outarr(1 To 7500, 1 To 22)
indi = 1
For i = 2 To 7500
If inarr(i, 10) = "OES" And inarr(i, 20) = "James" And inarr(i, 22) <= 12 Then
' copy row
For j = 1 To 22
outarr(indi, j) = inarr(i, j)
Next j
indi = indi + 1
End If
Next i
Worksheets.Add
ActiveSheet.Name = "James"
If indi > 1 Then
Range(Cells(1, 1), Cells(indi - 1, 22)) = outarr
End If
End Sub
------