G
Guest
Hi All
I have a little code listed below for which a blank row is inserted after each row containing "Group". When the little piece of code is run..it inserts two or sometimes four rows. Why is this happening
Thanks
Rozb
Sub FindGroupRow(
ActiveSheet.Range("A2:A1000").Selec
Rng = Selection.Rows.Coun
ActiveCell.Offset(0, 0).Selec
Application.ScreenUpdating = Fals
For i = 1 To Rn
If ActiveCell.Value <> " " The
Cells.Find(What:="group", after:=ActiveCell, LookIn:=xlValues, LookAt
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=
False).Offset(1, 0).Activat
Selection.EntireRow.Insert Shift:=xlDow
Els
ActiveCell.Offset(1, 0).Selec
End I
Next
Application.ScreenUpdating = Tru
End Sub
I have a little code listed below for which a blank row is inserted after each row containing "Group". When the little piece of code is run..it inserts two or sometimes four rows. Why is this happening
Thanks
Rozb
Sub FindGroupRow(
ActiveSheet.Range("A2:A1000").Selec
Rng = Selection.Rows.Coun
ActiveCell.Offset(0, 0).Selec
Application.ScreenUpdating = Fals
For i = 1 To Rn
If ActiveCell.Value <> " " The
Cells.Find(What:="group", after:=ActiveCell, LookIn:=xlValues, LookAt
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=
False).Offset(1, 0).Activat
Selection.EntireRow.Insert Shift:=xlDow
Els
ActiveCell.Offset(1, 0).Selec
End I
Next
Application.ScreenUpdating = Tru
End Sub