PDA

View Full Version : Runtime 424 Error "Object Required



rboothe
10-18-2010, 10:49 PM
Hi, I'm learning vba and get past the above error. Here's the code (to remove duplicated rows in a list).


Sub CleanList()
Range("A1").Select
Do While Not IsEmpty(ActiveCell.Offset(1, 0))
CheckCell = ActiveCell.Value
If CheckCell = ActiveCell.Offset(1, 0) Then
ActiveCell.Offset(1, 0).Delete.EntireRow
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

End Sub

HELP!!

Tinbendr
10-19-2010, 04:40 AM
Welcome to VBA Express!

ActiveCell.Offset(1, 0).EntireRow.Delete

rboothe
10-19-2010, 07:48 AM
Ouch!

It now works !! (that was a stupid mistake).

Thanks a lot!

speedypcnet
11-01-2010, 10:37 AM
Hi,

About this Runtime Error 424, you will usually encounter Runtime Error 424 when trying to use Microsoft Office Chart and Microsoft Access 200 at the same time. The solution is easy – just uninstall Internet Explorer 6.0. Instead, try using Mozilla Firefox or Opera. These are excellent choices for web browsers and they do not clash with MS Chart or MS Access. Of course, you can try and avoid using MS Chart and MS Access at the same time, but this isn't always possible. If you do choose to go this route, click on the chart and select "property toolbox." :)

mdmackillop
11-01-2010, 03:47 PM
Generally it is better to delete(insert) from the bottom up. Also, try to avoid selecting cells: your code will run more quickly


Option Explicit
Sub CleanList()
Dim LRw As Long
Dim i As Long
LRw = Cells(Rows.Count, 1).End(xlUp).Row
For i = LRw To 2 Step -1
If Cells(i, 1) = Cells(i - 1, 1) Then Rows(i).Delete
Next
End Sub