Run Time error 424 in code.

fvisions

Board Regular
Joined
Jul 29, 2008
Messages
191
Office Version
  1. 365
Platform
  1. Windows
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:
How do I take the same code and pull all rows for NO CHANGE and move them to row 10 in the Notes Tab?
Code:
'delete No Change Items and copy to Notes tab

Dim xRg As Range
Dim xCell As Range
Dim I As Long
Dim J As Long
Dim K As Long
I = Worksheets("Installation wkg").UsedRange.Rows.Count
J = Worksheets("Notes").UsedRange.Rows.Count
J = 1
'If J = 1 Then
'If Appication.WorksheetFunction.CountA(Worksheets("Notes").UsedRange) = 0 Then J = 0
'End If
Set xRg = Worksheets("Installation wkg").Range("v1:v" & I)
' On Error Resume Next
Application.ScreenUpdating = False
For K = 1 To xRg.Count
If CStr(xRg(K).Value) = "NO CHANGE" 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:
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Thank you so much for your time. I am a novice in VBA and miss the smallest of code, so thank you so much for your time. :love: You are the best!!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,392
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top