Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
RS
 
Posts: n/a
Default Adding a Blank Line with Change in Name

I have a list of contacts thousands of rows long. I have sorted the list by
contact and each contact name can make up more than two rows and up to ten.

I need to add a blank line for every change in contact name in the column to
make the worksheet easier to read. The macros I tried to develop only has a
set place to add a row but I would like it to work similar to a subtotal
statement. In a subtotal statement, you can ask for a total at every change
in a certain column. For every change in the column I would like to add a
blank row. Is this possible?

I appreciate any assistance with this.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Michael
 
Posts: n/a
Default Adding a Blank Line with Change in Name

Hi RS. You can adapt the code at Ron DeBruin's site to insert rows rather
than delete. Use a helper column, assuming your contacts start in A2, in B2
type: =if(A2=A2+1,"","N") and copy down. Use column B in the code at:
http://www.rondebruin.nl/delete.htm
Sincerely, Michael Colvin


"RS" wrote:

I have a list of contacts thousands of rows long. I have sorted the list by
contact and each contact name can make up more than two rows and up to ten.

I need to add a blank line for every change in contact name in the column to
make the worksheet easier to read. The macros I tried to develop only has a
set place to add a row but I would like it to work similar to a subtotal
statement. In a subtotal statement, you can ask for a total at every change
in a certain column. For every change in the column I would like to add a
blank row. Is this possible?

I appreciate any assistance with this.

  #3   Report Post  
Posted to microsoft.public.excel.misc
RS
 
Posts: n/a
Default Adding a Blank Line with Change in Name

Thank you, Michael. I looked at the information and it would work if I had
cells that did not change value to look up.

Could I get the statement for the "subtotal" function in VBA and modify it?
Where would I get the subtotal code?

RS

"Michael" wrote:

Hi RS. You can adapt the code at Ron DeBruin's site to insert rows rather
than delete. Use a helper column, assuming your contacts start in A2, in B2
type: =if(A2=A2+1,"","N") and copy down. Use column B in the code at:
http://www.rondebruin.nl/delete.htm
Sincerely, Michael Colvin


"RS" wrote:

I have a list of contacts thousands of rows long. I have sorted the list by
contact and each contact name can make up more than two rows and up to ten.

I need to add a blank line for every change in contact name in the column to
make the worksheet easier to read. The macros I tried to develop only has a
set place to add a row but I would like it to work similar to a subtotal
statement. In a subtotal statement, you can ask for a total at every change
in a certain column. For every change in the column I would like to add a
blank row. Is this possible?

I appreciate any assistance with this.

  #4   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben
 
Posts: n/a
Default Adding a Blank Line with Change in Name

RS

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(2, 1).EntireRow.Insert
Next i
With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
End With
End Sub


Gord Dibben MS Excel MVP

On Wed, 18 Jan 2006 08:50:07 -0800, "RS" wrote:

I have a list of contacts thousands of rows long. I have sorted the list by
contact and each contact name can make up more than two rows and up to ten.

I need to add a blank line for every change in contact name in the column to
make the worksheet easier to read. The macros I tried to develop only has a
set place to add a row but I would like it to work similar to a subtotal
statement. In a subtotal statement, you can ask for a total at every change
in a certain column. For every change in the column I would like to add a
blank row. Is this possible?

I appreciate any assistance with this.


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
how to change line spacing for text box in excel chart Anne Charts and Charting in Excel 1 October 5th 05 12:11 AM
Blank line in cells Dan Excel Discussion (Misc queries) 1 August 24th 05 05:54 PM
How do I use VBA to change line colors Dilbert00 Charts and Charting in Excel 2 June 4th 05 01:37 PM
Look for change next blank cell in Range Nigel Bennett Excel Worksheet Functions 1 March 13th 05 09:45 PM
Adding a text label to a line. Neil Charts and Charting in Excel 1 December 4th 04 08:41 PM


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