作者:多米音乐_34429718 | 来源:互联网 | 2023-07-13 15:09
I am trying to write a script which copies a row from Sheet 1 to Sheet 2, if the value for the first column of Sheet 1 is greater or equal to 10.
如果第一列的值大于或等于10,我正在尝试写一个脚本,该脚本将从表1到表2复制一行。
Sub Macro1()
Cells(1, 1).Select
For i = 1 To ActiveCell.SpecialCells(xlLastCell).Row
Cells(i, 1).Select
If ActiveCell.Value >= 10 Then
Rows(ActiveCell.Row).Select
Rows(i & ":").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
End If
Next i
End Sub
3 个解决方案