One more request on row insertion.

S

simplymidori76

I'm about to take off on maternity leave in 8 days and I appreciate
all the help on this.

With the help of a couple programmers.

I've managed to get this - It works fine only the rows do not insert
properly after the first set. The background color changes over the
data and not adding a new row. I've uploaded an image example.

http://bp1.blogger.com/_0XguicNvp2w/Rf_jF7Txk6I/AAAAAAAAANk/zyRycI54QQs/s1600-h/example.bmp

Thanks again for all the efforts.


Option Explicit
Dim MyCell, MyRng As Range
Dim i As Integer


Private Sub CommandButton1_Click()
Set MyRng = [a1:a65000]
For Each MyCell In MyRng
If InStr(MyCell.Value, "Total") > 0 Then
MyCell.Offset(1, 0).Select
Do While i < 4
ActiveCell.EntireRow.Insert
i = i + 1
Loop
ActiveCell.Value = "Avails"
ActiveCell.EntireRow.Interior.ColorIndex = 5
ActiveCell.Offset(1, 0).Value = "Left"
ActiveCell.Offset(1, 0).EntireRow.Interior.ColorIndex = 6
End If
Next MyCell
i = 0
End Sub
 
S

simplymidori76

THANKS STEVE & PAUL for your help on this!!!!

With your help I've got it to work..

Please, disregard this request.

Regards, Gwen
 

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