FInd value and insert rows below

G

Guest

I have numbers in column A from 1,2,3,4,5,..etc.
I need a macro that will find a number for example "3" and insert 4 rows
under the row that has the number "3" in column A.
Any help will be appreciated.
Thanks
 
G

Guest

Right click sheet tab, view code and paste this in:-

Sub atomic()
For x = Range("A65536").End(xlUp).Row To 1 Step -1
If Cells(x, 1).Value = 3 Then
Cells(x + 1, 1).Select
For y = 1 To 4
Selection.EntireRow.Insert
Next
End If
Next
End Sub


Mike
 

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