I have a column containing the following values: A1 = 0 A2 = 1 A3 = 3 A4 = 4 A5 = 0 A6 = 1
I wish to select column A and insert a new column above any instance of 0.
I have tried the following code but I am getting errors and not sure what is wrong. I believe it is OFFSET that is causing the problem, I'm not 100% sure.
Dim c As Range For Each c In Range("A:A") If c.Value Like "0" Then c.Offset(-1, 0).EntireRow.Insert End If Next c
It says the following:
Run-time error '1004': Application-defined or object-defined error.
Then it highlights
c.Offset(-1, 0).EntireRow.Insert in the code