PC Review


Reply
Thread Tools Rate Thread

Auto Insert Row When Column Amount Changes

 
 
Ronald \Tony\ Johnson
Guest
Posts: n/a
 
      4th May 2005
Here is an example of what I am talking about.

A B C D
1 A B C D
2 2 41100 274 584
3 2 41100 274 625
4 2 41100 274 333
5 2 41100 274 102
6 2 41100 274 957
7 2 41100 274 362
8 2 41100 274 651
9 2 41100 274 611
10 2 41100 284 965
11 2 41100 284 336
12 2 41100 284 251
13 2 41100 284 362
14 2 41100 284 859
15 2 41100 284 512
16 2 41100 284 669
17 2 41100 284 512


I need to insert a new row every time the amount in Column "C"
changes to a different amount than the previous one.
There are approx 16,000 rows in this file or I would not be asking..lol

Thanks for any help you can offer.


--
Tony Johnson
 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      4th May 2005
Tony,

One way...
Use Data | Subtotals on column C.
Collapse the displayed subtotals so only the sub-totaled
and Grand total rows are showing.
Use Edit | GoTo | Special and select the visible cells.
Delete them and expand the sub-total display.

Regards,
Jim Cone
San Francisco, USA


"Ronald "Tony" Johnson" <(E-Mail Removed)> wrote in message
news:O6%(E-Mail Removed)...
Here is an example of what I am talking about.
A B C D
1 A B C D
2 2 41100 274 584
3 2 41100 274 625
4 2 41100 274 333
5 2 41100 274 102
6 2 41100 274 957
7 2 41100 274 362
8 2 41100 274 651
9 2 41100 274 611
10 2 41100 284 965
11 2 41100 284 336
12 2 41100 284 251
13 2 41100 284 362
14 2 41100 284 859
15 2 41100 284 512
16 2 41100 284 669
17 2 41100 284 512


I need to insert a new row every time the amount in Column "C"
changes to a different amount than the previous one.
There are approx 16,000 rows in this file or I would not be asking..lol
Thanks for any help you can offer.
Tony Johnson
 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      4th May 2005
Macro solution OK?

Sub InsertRow_At_Change()
Dim i As Long
With Application
.Calculation = xlManual
.ScreenUpdating = False
End With
For i = Cells(Rows.Count, 3).End(xlUp).Row To 2 Step -1
If Cells(i - 1, 3) <> Cells(i, 3) Then _
Cells(i, 3).Resize(1, 3).EntireRow.Insert
Next i
With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
End With
End Sub


Gord Dibben Excel MVP

On Tue, 3 May 2005 21:42:42 -0400, "Ronald \"Tony\" Johnson"
<(E-Mail Removed)> wrote:

>Here is an example of what I am talking about.
>
> A B C D
> 1 A B C D
> 2 2 41100 274 584
> 3 2 41100 274 625
> 4 2 41100 274 333
> 5 2 41100 274 102
> 6 2 41100 274 957
> 7 2 41100 274 362
> 8 2 41100 274 651
> 9 2 41100 274 611
> 10 2 41100 284 965
> 11 2 41100 284 336
> 12 2 41100 284 251
> 13 2 41100 284 362
> 14 2 41100 284 859
> 15 2 41100 284 512
> 16 2 41100 284 669
> 17 2 41100 284 512
>
>
>I need to insert a new row every time the amount in Column "C"
>changes to a different amount than the previous one.
>There are approx 16,000 rows in this file or I would not be asking..lol
>
>Thanks for any help you can offer.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
auto row insert where TRUE in column A Mr BT Microsoft Excel Programming 1 16th May 2008 07:58 PM
A way to auto insert at top of each column with each entry? =?Utf-8?B?Q2hhbm5pbmc=?= Microsoft Excel Misc 4 9th Sep 2006 05:56 AM
Insert Row When Column Amount Changes Ronald \Tony\ Johnson Microsoft Excel Misc 2 5th May 2005 01:37 PM
Insert Row When Column Amount Changes Ronald \Tony\ Johnson Microsoft Excel New Users 1 4th May 2005 02:58 PM
Insert New Row When Column Amount Changes Ronald \Tony\ Johnson Microsoft Excel Worksheet Functions 1 4th May 2005 02:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:00 AM.