Sub Jesse()
Range("C1").Select
Do Until Range(ActiveCell, ActiveCell).Value = "stop"
Range(ActiveCell, ActiveCell).Offset(1, 0).Select
Range(ActiveCell, ActiveCell).Offset(4, 0).Select
If Range(ActiveCell, ActiveCell).Value <> 4 Then Selection.EntireRow.Insert
Loop
End Sub
B C
Axelman, Norman #Value
1710 NE 170 Street #Value
Miami, FL 33162 #Value
Email #Value
305-323-1005 4
Gomer, G #Value
949 President St #Value
Brooklyn, NY #Value
Email #Value
Green, D #Value
Above is a sample of my data. The code I wrote starts at C1; moves down one cell, then moves down four rows. If the value of that cell equals '4', the code loops. Works perfectly until it moves down four rows and finds the text #Value. (this is actually text in the cell). but when it gets to this cell, instead of evaluating the cell as not being equal to '4' and inserting a row, I get a 'type mismatch' error 13.
Any ideas? Thanks!
Range("C1").Select
Do Until Range(ActiveCell, ActiveCell).Value = "stop"
Range(ActiveCell, ActiveCell).Offset(1, 0).Select
Range(ActiveCell, ActiveCell).Offset(4, 0).Select
If Range(ActiveCell, ActiveCell).Value <> 4 Then Selection.EntireRow.Insert
Loop
End Sub
B C
Axelman, Norman #Value
1710 NE 170 Street #Value
Miami, FL 33162 #Value
Email #Value
305-323-1005 4
Gomer, G #Value
949 President St #Value
Brooklyn, NY #Value
Email #Value
Green, D #Value
Above is a sample of my data. The code I wrote starts at C1; moves down one cell, then moves down four rows. If the value of that cell equals '4', the code loops. Works perfectly until it moves down four rows and finds the text #Value. (this is actually text in the cell). but when it gets to this cell, instead of evaluating the cell as not being equal to '4' and inserting a row, I get a 'type mismatch' error 13.
Any ideas? Thanks!