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
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