Runtime error 1004

Z

Zippy

Can anyone help me as to why I get a run time error 1004 - Insert method of
Range Class failed
when this bit of code reaches the "Selection" line?

Sub compare()

Row = 1
Do
If (Cells(Row, 1) <> Cells(Row, 4)) Then
Cells(Row, 4).Select
Selection.Insert shift:=x1down
Else
Row = Row + 1
End If
Loop Until Row = 20

End Sub
 
G

Guest

Looks like it should be "xlDown" instead of "x1Down" -- use an "l" instead of
a "1"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top