I am getting a Run time error 424 Object required for the code line starting with I = Worksheets….
VBA Code:
Sub MoveRowBasedOnCellValue()
Dim xRg As Range
Dim xCell As Range
Dim I As Long
Dim J As Long
Dim K As Long
I = Worksheets("InstallationWKG").UsedRange.Row.Count
J = Worksheets("Notes").UsedRange.Rows.Count
If J = 1 Then
If Appication.worksheetFunctio.CountA(Worksheets("Notes").UsedRange) = 0 Then J = 0
End If
Set xRg = Worksheets("InstallationWKG").Range("v1:v" & I)
On Error Resume Next
Application.ScreenUpdating = False
For K = 1 To xRg.Count
If CStr(xRg(K).Value) = "end" Then
xRg(K).EntireRow.Copy Destination:=Worksheets("Notes").Range("a" & J + 1)
J = J + 1
End If
Next
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: