Balajibenz
Board Regular
- Joined
- Nov 18, 2020
- Messages
- 80
- Office Version
- 2013
- Platform
- Windows
I have below code which i use for copying the filtered data to another sheet(ws2).
what i am looking for right now to is to add another filter in column K, I have defined it as temp3 in above code and looking to include filter as temp3 = "Sam" or "Alok" or "Kristy". Can someone help me with this.. Thanks in advance.
VBA Code:
Sub VBA()
ws1.Activate
lr = ws1.Cells(Rows.Count, 16).End(xlUp).Row
For Each c In ws1.Range("P2:P" & lr)
temp2 = Left(c, 3)
temp = Right(c, 3)
temp3 = c.Offset(0, -5)
If temp2 = "180" And _
(temp = "341" Or _
temp = "342" Or _
temp = "642") Then
ReDim Preserve arr(i)
arr(i) = CStr(c)
i = i + 1
End If
With ws1.Range("A1").CurrentRegion
.AutoFilter 16, Array(arr), 7
.Offset(1).Copy ws2.Cells(2, 1)
.AutoFilter
End Sub
what i am looking for right now to is to add another filter in column K, I have defined it as temp3 in above code and looking to include filter as temp3 = "Sam" or "Alok" or "Kristy". Can someone help me with this.. Thanks in advance.