我试图创建一个vba代码,但我没有成功。
我想在COLUMN" F"上搜索价值:"已回答" 然后从" COLUM B到F"并粘贴在工作表上" ControlAnswered" LASTROW;
答案 0 :(得分:2)
试试这个,
Sub SpecialCopy()
Dim targetSh As Worksheet
Set targetSh = ThisWorkbook.Worksheets("ControlAnswered")
Dim i As Long
For i = 1 To Cells(Rows.Count, "F").End(xlUp).Row
If Cells(i, 6).Value = "Answered" Then
Range(Cells(i, 2), Cells(i, 6)).Copy Destination:=targetSh.Range("A" & targetSh.Cells(Rows.Count, "A").End(xlUp).Row + 1)
End If
Next i
End Sub
我应该说你不会总是找到能为你编写代码的人