Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / September 2005

Tip: Looking for answers? Try searching our database.

add a row after every unique number

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tri_p - 30 Sep 2005 12:47 GMT
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
Gord Dibben - 30 Sep 2005 19:48 GMT
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

>Is there a function that will add an entire row after a unspecified group of
>number.
[quoted text clipped - 6 lines]
>
>Thanks
tri_p - 30 Sep 2005 20:01 GMT
gord..you da man!  That worked AWESOME!!

> tri_p
>
[quoted text clipped - 33 lines]
> >
> >Thanks
Gord Dibben - 30 Sep 2005 22:12 GMT
Aw shucks<g>

Thanks for the feedback.

Gord

>gord..you da man!  That worked AWESOME!!
>
[quoted text clipped - 35 lines]
>> >
>> >Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.