I have read a bunch of posts about inserting a row into excel through VBA, but none helped.
I tried using this code
Code:
Do Until some_condition = true
Activecell.Offset(1, 0).Select
If some_condition = true then
ActiveCell.EntireRow.Select
Selection.Insert Shift:=xlDown
End if
Loop
but it gives me a Run-Time Error '1004', Insert method of Range class failed. The purpose of the code is to insert a row once it finds the right place/row to insert.
I saw something about using the following code:
Code:
Rows("2:2").Insert Shift:=xlDown
But that gives me the same error too.
Any ideas why my code isn't working? I am using VB 6.3