Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Number of labels on X-axis one more than number of values on Y-axi | Charts and Charting in Excel | |||
Need number of Saturdays and number of Sundays between 2 dates | Excel Worksheet Functions | |||
unique sequential number excel 2000 | Excel Discussion (Misc queries) | |||
how can i put a unique number in a header for a git certificat for | Excel Discussion (Misc queries) | |||
Count number of unique items in a column that contains duplicates | Excel Worksheet Functions |