Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
tri_p
 
Posts: n/a
Default add a row after every unique number

Is there a function that will add an entire row after a unspecified group of
number.

ie I have some numbers, these numbers could be negitave numbers and range in
string size. There will be groupings and after each grouping upon a new
number I would like to add an entire row (for later calculations).

Is this possible (for someone with minimal programming exp)?

Thanks
  #2   Report Post  
Gord Dibben
 
Posts: n/a
Default

tri_p

Assuming the numbers are in Column A, run this macro.

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

For column C.........

For i = Cells(Rows.Count, 3).End(xlUp).Row To 2 Step -1
If Cells(i - 1, 3) < Cells(i, 3) Then _


Gord Dibben Excel MVP

On Fri, 30 Sep 2005 04:47:03 -0700, "tri_p"
wrote:

Is there a function that will add an entire row after a unspecified group of
number.

ie I have some numbers, these numbers could be negitave numbers and range in
string size. There will be groupings and after each grouping upon a new
number I would like to add an entire row (for later calculations).

Is this possible (for someone with minimal programming exp)?

Thanks


  #3   Report Post  
tri_p
 
Posts: n/a
Default

gord..you da man! That worked AWESOME!!

"Gord Dibben" wrote:

tri_p

Assuming the numbers are in Column A, run this macro.

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

For column C.........

For i = Cells(Rows.Count, 3).End(xlUp).Row To 2 Step -1
If Cells(i - 1, 3) < Cells(i, 3) Then _


Gord Dibben Excel MVP

On Fri, 30 Sep 2005 04:47:03 -0700, "tri_p"
wrote:

Is there a function that will add an entire row after a unspecified group of
number.

ie I have some numbers, these numbers could be negitave numbers and range in
string size. There will be groupings and after each grouping upon a new
number I would like to add an entire row (for later calculations).

Is this possible (for someone with minimal programming exp)?

Thanks



  #4   Report Post  
Gord Dibben
 
Posts: n/a
Default

Aw shucks<g

Thanks for the feedback.


Gord

On Fri, 30 Sep 2005 12:01:02 -0700, "tri_p"
wrote:

gord..you da man! That worked AWESOME!!

"Gord Dibben" wrote:

tri_p

Assuming the numbers are in Column A, run this macro.

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

For column C.........

For i = Cells(Rows.Count, 3).End(xlUp).Row To 2 Step -1
If Cells(i - 1, 3) < Cells(i, 3) Then _


Gord Dibben Excel MVP

On Fri, 30 Sep 2005 04:47:03 -0700, "tri_p"
wrote:

Is there a function that will add an entire row after a unspecified group of
number.

ie I have some numbers, these numbers could be negitave numbers and range in
string size. There will be groupings and after each grouping upon a new
number I would like to add an entire row (for later calculations).

Is this possible (for someone with minimal programming exp)?

Thanks




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
Number of labels on X-axis one more than number of values on Y-axi Gudrun Charts and Charting in Excel 5 August 26th 05 01:55 PM
Need number of Saturdays and number of Sundays between 2 dates Class316 Excel Worksheet Functions 1 June 10th 05 02:47 AM
unique sequential number excel 2000 Ches Excel Discussion (Misc queries) 0 May 13th 05 10:55 PM
how can i put a unique number in a header for a git certificat for Konstantine Excel Discussion (Misc queries) 2 April 15th 05 05:51 AM
Count number of unique items in a column that contains duplicates Steembeem Excel Worksheet Functions 3 February 2nd 05 12:51 AM


All times are GMT +1. The time now is 07:34 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"