Excel Macro To Cut Rows And Paste Into Another Worksheet
问题 I am trying to get a macro to cut and paste certain rows from sheet ASR to sheet LS, whenever column I is equal to LS. Sub MoveLS() Dim i As Variant Dim endrow As Integer endrow = Sheets("ASR").Range("A" & Rows.Count).End(xlUp).Row For i = 2 To endrow If Cells(i, "I").Value = "LS" Then Cells(i, "I").EntireRow.Cut Destination:=Sheets("LS").Range("A" & Rows.Count).End(xlUp).Offset(1) End If Next End Sub I have been staring at different variations of this code on and off for the past 8 hours and