Hi,
Right click the sheet tab of the sheet you are saerching, view code and
paste this in and run it
Sub copyit()
searchvalue = "Something"
Dim myrange, MyRange1 As Range
lastrow = Cells(Rows.Count, "J").End(xlUp).Row
Set myrange = Range("J1:J" & lastrow)
For Each c In myrange
If c.Value = searchvalue And IsEmpty(c.Offset(, 5)) And
IsEmpty(c.Offset(, 7)) Then
If MyRange1 Is Nothing Then
Set MyRange1 = c.EntireRow
Else
Set MyRange1 = Union(MyRange1, c.EntireRow)
End If
End If
Next
If Not MyRange1 Is Nothing Then
MyRange1.Copy
Sheets("Sheet2").Range("A1").PasteSpecial
End If
End Sub
Mike
"Ken" wrote:
> Hi group,
> I have found a macro on the net that might be the answer to my
> earlier post:
>
> http://groups.google.com/group/micro...71e2ff5d?hl=en
>
> if I can resolve this IF, Then statement syntax:
>
> 'If value in column J = LSearchValue, and column O or Q are empty,
> copy entire row to Sheet2
> If Range("J" & CStr(LSearchRow)).Value = LSearchValue &
> Range("O").Value = "" & Range("Q").Value = ""
> Then
>
> I know that's not the correct way to do that, but can anyone tell me
> what needs to be changed? Any guidance will be very much appreciated!!
> Ken
>