Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Inserting a single row to separate data multiple times

How do I insert a row for every change in value for column C?

I need it to separate data
Currently I sort the spreadsheet and then scroll thru the entire thing
inserting rows for each variable listed in column C.

Example: Value in rows 1 thru 5 of column C are 27; and the value in rows 6
thru 8 are 28; rows 9 & 10 are 29 and so on and so on.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Inserting a single row to separate data multiple times

First add a header row if you haven't.

Then after you sort your data, select the data (header row through the last row
of data) and do:
Data|subtotals

And follow the wizard from there.

You can even add subtotals to columns/fields that you want!

Luthdawg wrote:

How do I insert a row for every change in value for column C?

I need it to separate data
Currently I sort the spreadsheet and then scroll thru the entire thing
inserting rows for each variable listed in column C.

Example: Value in rows 1 thru 5 of column C are 27; and the value in rows 6
thru 8 are 28; rows 9 & 10 are 29 and so on and so on.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Inserting a single row to separate data multiple times

Try this:

Sub InsertRow()

With Worksheets("sheet1") '<=== change to suit
Lastrow = .Cells(Rows.Count, "C").End(xlUp).Row
For irow = Lastrow To 2 Step -1
If .Cells(irow - 1, "C") < .Cells(irow, "C") Then
Rows(irow).Insert Shift:=xlDown
End If
Next
End With
End Sub

"Luthdawg" wrote:

How do I insert a row for every change in value for column C?

I need it to separate data
Currently I sort the spreadsheet and then scroll thru the entire thing
inserting rows for each variable listed in column C.

Example: Value in rows 1 thru 5 of column C are 27; and the value in rows 6
thru 8 are 28; rows 9 & 10 are 29 and so on and so on.

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
Using SUBSTITUTE multiple times on single cell of data Cameron Excel Discussion (Misc queries) 1 December 6th 06 11:58 PM
Inserting Data Repeated Times Dan Spracklin Excel Discussion (Misc queries) 1 November 10th 06 05:51 PM
Combining data from multiple worksheets and separate spreadsheets kfletchb Excel Discussion (Misc queries) 1 August 10th 06 07:53 PM
Displaying single and multiple data series.Single data series Donald Macleod Charts and Charting in Excel 2 January 30th 06 02:52 AM
Multiple dates, times, or formulas in a single cell PM-S Excel Discussion (Misc queries) 2 January 12th 06 04:19 AM


All times are GMT +1. The time now is 06:29 AM.

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

About Us

"It's about Microsoft Excel"