Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change the rows to the columns Nikki Excel Discussion (Misc queries) 2 August 6th 06 09:58 PM
How do I change the rows number? Zoe Excel Worksheet Functions 1 May 25th 06 04:02 PM
How do change rows to colums AND columns to rows Colleen A Excel Discussion (Misc queries) 7 December 30th 05 12:40 AM
excel deleting rows last cell does not change. How to change? mrubey Excel Discussion (Misc queries) 3 August 25th 05 08:38 PM
Can you change rows to columns Brent Excel Discussion (Misc queries) 2 June 9th 05 05:47 AM


All times are GMT +1. The time now is 05:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"