Hi,
Presently I have 1 button that has the macro below assigned which searches Site Print Column A and matching the value with Cell F9 in Criteria and then pulling the entire row into Search Results.
Sub accountmoving()
Dim c As Range, d As Range
If Range("F9") = "" Then
MsgBox "Please Select an Account"
Else
Worksheets("Search Results").Activate
For Each c In Worksheets("Site Print").Range("A1:A8000")
For Each d In Worksheets("Criteria").Range("F9")
If c = d Then
c.EntireRow.Copy Worksheets("Search Results").Range("A65536").End(xlUp).Offset(1, 0)
Exit For
End If
Next
Next
End If
End Sub
I have another button that does somthing very similar but searches a different column, again pulling the matching cell's row into Search Results. Code Below...
Sub itemmoving()
Dim c As Range, d As Range
If Range("F11") = "" Then
MsgBox "Please Select an Item Description"
Else
Worksheets("Search Results").Activate
For Each c In Worksheets("Site Print").Range("L1:L8000")
For Each d In Worksheets("Criteria").Range("F11")
If c = d Then
c.EntireRow.Copy Worksheets("Search Results").Range("A65536").End(xlUp).Offset(1, 0)
Exit For
End If
Next
Next
End If
End Sub
What I am after doing is creating another button that basically merges the two searches so if both columns match then it copys the entire row. I did try and do it myself by running the first routine into a new sheet then call the next routine from that sheet, copying the results into Serach Results. Problem with this is if one search field was left blank then this would affect the results.
Any pointers/help would be greatly appreciated.
Thanks
Presently I have 1 button that has the macro below assigned which searches Site Print Column A and matching the value with Cell F9 in Criteria and then pulling the entire row into Search Results.
Sub accountmoving()
Dim c As Range, d As Range
If Range("F9") = "" Then
MsgBox "Please Select an Account"
Else
Worksheets("Search Results").Activate
For Each c In Worksheets("Site Print").Range("A1:A8000")
For Each d In Worksheets("Criteria").Range("F9")
If c = d Then
c.EntireRow.Copy Worksheets("Search Results").Range("A65536").End(xlUp).Offset(1, 0)
Exit For
End If
Next
Next
End If
End Sub
I have another button that does somthing very similar but searches a different column, again pulling the matching cell's row into Search Results. Code Below...
Sub itemmoving()
Dim c As Range, d As Range
If Range("F11") = "" Then
MsgBox "Please Select an Item Description"
Else
Worksheets("Search Results").Activate
For Each c In Worksheets("Site Print").Range("L1:L8000")
For Each d In Worksheets("Criteria").Range("F11")
If c = d Then
c.EntireRow.Copy Worksheets("Search Results").Range("A65536").End(xlUp).Offset(1, 0)
Exit For
End If
Next
Next
End If
End Sub
What I am after doing is creating another button that basically merges the two searches so if both columns match then it copys the entire row. I did try and do it myself by running the first routine into a new sheet then call the next routine from that sheet, copying the results into Serach Results. Problem with this is if one search field was left blank then this would affect the results.
Any pointers/help would be greatly appreciated.
Thanks