Inserting rows via macro

  • Thread starter Thread starter clane
  • Start date Start date
C

clane

Hello,

I am trying to insert a row in colum b below each cell that contains
1

thanks much

Chuc
 
Try this one

Sub test()
Dim Rng As Range
Dim findstring As String
findstring = "1"
Set Rng = Range("B:B").Find(What:=findstring, LookAt:=xlWhole)
While Not (Rng Is Nothing)
Rng.EntireRow.Insert
Set Rng = Range("B" & Rng.Row + 1 & ":B" & Rows.Count) _
.Find(What:=findstring, LookAt:=xlWhole)
Wend
End Sub
 

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

Back
Top