I have a worksheet where Yes or No appears in column A. I require all the rows with Yes to be copied across to another worksheet in the same workbook. Hope someone can help with a piece of code or a formula.
Thanks
Thanks
Sub MoveData()
Dim r As Range, LR As Long
With Sheets("Sheet1")
LR = .Range("A" & Rows.Count).End(xlUp).Row
Set r = .Range("A2").Resize(LR - 1)
.Range("A1").AutoFilter field:=1, Criteria1:="Yes"
With r.SpecialCells(xlCellTypeVisible).EntireRow
.Copy Destination:=Sheets("Sheet2").Range("A2")
End With
.Range("A1").AutoFilter
End With
End Sub
Sub MoveData()
Dim r As Range, LR As Long
With Sheets("Sheet1")
LR = .Range("A" & Rows.Count).End(xlUp).Row
Set r = .Range("C2").Resize(LR - 1)
.Range("A1").AutoFilter field:=3, Criteria1:="Replace"
With r.SpecialCells(xlCellTypeVisible).EntireRow
.Copy Destination:=Sheets("Sheet2").Range("A5")
[COLOR="Red"].Delete[/COLOR]
End With
.Range("A1").AutoFilter
End With
End Sub