Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to add 3 rows with every change?
Try the sub below on a spare copy of your file ..
(sub taken from a post in .programming, modified to suit your col P, data assumed running in P2 down) Sub InsertRow_At_Change() Dim i As Long With Application .Calculation = xlManual .ScreenUpdating = False End With For i = Cells(Rows.Count, 16).End(xlUp).Row To 3 Step -1 If Cells(i - 1, 16) < Cells(i, 16) Then _ Cells(i, 1).Resize(3, 1).EntireRow.Insert Next i With Application .Calculation = xlAutomatic .ScreenUpdating = True End With End Sub -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "graydon" wrote: Hi I have a database where there are only 2 types of information on each row within the 'P' column ('PE' and 'IP') I was wondering if somebody might show me how I could add 3 rows eachtime the next level changes (i.e from IP to PE) and (PE to IP) the blocks of continuity vary, there could be 30 IP's then 2 PE's and then 7 IP's etc. I just need 3 added rows each time they change from one to the other Thanks G |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to add 3 rows with every change?
Glad it worked fine for you.
Thanks for feeding back. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "graydon" wrote: Thanks Max that worked great and saved so much time G |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change the rows to the columns | Excel Discussion (Misc queries) | |||
How do I change the rows number? | Excel Worksheet Functions | |||
How do change rows to colums AND columns to rows | Excel Discussion (Misc queries) | |||
excel deleting rows last cell does not change. How to change? | Excel Discussion (Misc queries) | |||
Can you change rows to columns | Excel Discussion (Misc queries) |