Hello friends,
I have a code which is working good for column1 criteria, but i need to drill down further for column2, column3 filtering.. and then copying those filetered records into another sheet(sheet2).
my query is to filter custom rows based on criteria of columns like column1, column2, column3 & copy complete row in another sheet (sheet2)
Pls check the code which is working good for column1 filtering, but still need to filter for column1 & column2.
Pls guide here...
Thanks.
Code:
I have a code which is working good for column1 criteria, but i need to drill down further for column2, column3 filtering.. and then copying those filetered records into another sheet(sheet2).
my query is to filter custom rows based on criteria of columns like column1, column2, column3 & copy complete row in another sheet (sheet2)
Pls check the code which is working good for column1 filtering, but still need to filter for column1 & column2.
Pls guide here...
Thanks.
Code:
Code:
Sub CustomCopy()
Dim strsearch As String
Dim lastline As Long, toCopy As Long
Dim searchColumn As String
Dim i As Long, j As Long
Dim c As Range
strsearch = CStr(InputBox("Enter the value to search for"))
lastline = Range("B" & Rows.Count).End(xlUp).Row
j = 1
For i = 1 To lastline
If Range("B" & i).Value = strsearch Then
Rows(i).Copy Destination:=Sheets(2).Rows(j)
j = j + 1
End If
Next
MsgBox j - 1 & " row(s) copied to Sheet2."
End Sub