Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Insert lines at each change in value

I need to insert a line at each change in "property Number" in a very long
list of data. Can I set it up to automatically insert a line at each change
(like subtotal, but without the subtotal data)?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 269
Default Insert lines at each change in value

Lisa, How about this? Copy the sub into a standard module and run it.
It assumes you want to work with the active worksheet. It also
assumes that your property numbers are in column A and that you don't
want to look any higher than row 2. HTH, James

Sub InsertAtChange()
Dim r As Long
For r = Cells(65536, "a").End(xlUp).Row To 3 Step -1
If Cells(r, "a") < "" And Cells(r, "a") < Cells(r - 1, "a")
Then
Rows(r).EntireRow.Insert
End If
Next r
End Sub

LisaVH wrote:
I need to insert a line at each change in "property Number" in a very long
list of data. Can I set it up to automatically insert a line at each change
(like subtotal, but without the subtotal data)?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Insert lines at each change in value

Thank You!

"Zone" wrote:

Lisa, How about this? Copy the sub into a standard module and run it.
It assumes you want to work with the active worksheet. It also
assumes that your property numbers are in column A and that you don't
want to look any higher than row 2. HTH, James

Sub InsertAtChange()
Dim r As Long
For r = Cells(65536, "a").End(xlUp).Row To 3 Step -1
If Cells(r, "a") < "" And Cells(r, "a") < Cells(r - 1, "a")
Then
Rows(r).EntireRow.Insert
End If
Next r
End Sub

LisaVH wrote:
I need to insert a line at each change in "property Number" in a very long
list of data. Can I set it up to automatically insert a line at each change
(like subtotal, but without the subtotal data)?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 269
Default Insert lines at each change in value

Glad it worked for you. James
LisaVH wrote:
Thank You!

"Zone" wrote:

Lisa, How about this? Copy the sub into a standard module and run it.
It assumes you want to work with the active worksheet. It also
assumes that your property numbers are in column A and that you don't
want to look any higher than row 2. HTH, James

Sub InsertAtChange()
Dim r As Long
For r = Cells(65536, "a").End(xlUp).Row To 3 Step -1
If Cells(r, "a") < "" And Cells(r, "a") < Cells(r - 1, "a")
Then
Rows(r).EntireRow.Insert
End If
Next r
End Sub

LisaVH wrote:
I need to insert a line at each change in "property Number" in a very long
list of data. Can I set it up to automatically insert a line at each change
(like subtotal, but without the subtotal data)?




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
Automatically Insert DATE, so that DATE will NOT change Cie Excel Worksheet Functions 4 April 4th 05 05:51 PM
Make default insert sheet to have grid lines Bruce Roberson New Users to Excel 4 January 20th 05 01:27 AM
insert a space in a phone #. change (123)456-7890 to (123) 456-78 leo Excel Worksheet Functions 6 January 15th 05 02:57 AM
How do I change the default color of the tag for insert c... [email protected] Excel Discussion (Misc queries) 1 December 18th 04 12:01 AM
How do I change the default color of the tag for insert c... ntwrkengnr Excel Discussion (Misc queries) 1 December 17th 04 07:34 PM


All times are GMT +1. The time now is 01:11 PM.

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"