sasa
05-04-2008, 12:47 AM
I need a little help. I have this macro:
Sub CopyAndInsertRows()
Application.ScreenUpdating = False
Dim iCount As Integer
iCount = 1
Do
Selection.EntireRow.Copy
Selection.Insert Shift:=xlDown
iCount = iCount - 1
Loop Until iCount = 0
Application.ScreenUpdating = True
End Sub
It copy and insert row after I select a particular row. But I need to modify this the way it copy and insert a row the same way it does it but on matching criteria.
Example: It duplicates on column A all the rows where I Have the same item:
Before
a
b
c
d
after
a
a
b
c
d
thank you on advance
Sasa
Sub CopyAndInsertRows()
Application.ScreenUpdating = False
Dim iCount As Integer
iCount = 1
Do
Selection.EntireRow.Copy
Selection.Insert Shift:=xlDown
iCount = iCount - 1
Loop Until iCount = 0
Application.ScreenUpdating = True
End Sub
It copy and insert row after I select a particular row. But I need to modify this the way it copy and insert a row the same way it does it but on matching criteria.
Example: It duplicates on column A all the rows where I Have the same item:
Before
a
b
c
d
after
a
a
b
c
d
thank you on advance
Sasa