Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inseart row if cell number is repeating
Hi
I have a data sheet, which is a sales data which contains item particulars. each invoice contains one or more items. many of them is single item which ends in single row. if more items are there, it comes in different rows. i want to inseart one row each if the invoice number is repeating to two three up to 20 rows. new row need to come top of the cell number 1 rice 10 kg 27.00 270.00 2 oil 3 kl 80-00 240.00 3 Rice 5 kg 33.00 165.00 3 oil 1 kl 80.00 80.00 4 Salt 1 kg 10.00 10.00 the invoce number (cell number) "first column" 3 is repeating twice. 1 rice 10 kg 27.00 270.00 2 oil 3 kl 80-00 240.00 3 Rice 5 kg 33.00 165.00 3 oil 1 kl 80.00 80.00 4 Salt 1 kg 10.00 10.00 i insearted one row after cell number 2, anyonce can help to creat one macro for this?(Inseart row with condition) thanks Jophy |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inseart row if cell number is repeating
Public Sub ProcessData()
Dim i As Long Dim LastRow As Long Application.ScreenUpdating = False With ActiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = LastRow - 2 To 2 Step -1 If .Cells(i, "A").Value < .Cells(i + 1, "A").Value And _ .Cells(i + 1, "A").Value = .Cells(i + 2, "A").Value Then .Rows(i + 1).Insert End If Next i End With Application.ScreenUpdating = True End Sub -- __________________________________ HTH Bob "JoeM" wrote in message ... Hi I have a data sheet, which is a sales data which contains item particulars. each invoice contains one or more items. many of them is single item which ends in single row. if more items are there, it comes in different rows. i want to inseart one row each if the invoice number is repeating to two three up to 20 rows. new row need to come top of the cell number 1 rice 10 kg 27.00 270.00 2 oil 3 kl 80-00 240.00 3 Rice 5 kg 33.00 165.00 3 oil 1 kl 80.00 80.00 4 Salt 1 kg 10.00 10.00 the invoce number (cell number) "first column" 3 is repeating twice. 1 rice 10 kg 27.00 270.00 2 oil 3 kl 80-00 240.00 3 Rice 5 kg 33.00 165.00 3 oil 1 kl 80.00 80.00 4 Salt 1 kg 10.00 10.00 i insearted one row after cell number 2, anyonce can help to creat one macro for this?(Inseart row with condition) thanks Jophy |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inseart row if cell number is repeating
Thanks bob its fantastic
god bless you jophy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I keep from repeating a number in the same column? | Excel Discussion (Misc queries) | |||
Repeating Number | Excel Worksheet Functions | |||
random number without repeating? | Excel Worksheet Functions | |||
how to stop repeating a number in worksheet(e.g. cell A1 is 6655 . | Excel Discussion (Misc queries) | |||
Random Number Non Repeating ... | Excel Discussion (Misc queries) |