Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatically Insert DATE, so that DATE will NOT change | Excel Worksheet Functions | |||
Make default insert sheet to have grid lines | New Users to Excel | |||
insert a space in a phone #. change (123)456-7890 to (123) 456-78 | Excel Worksheet Functions | |||
How do I change the default color of the tag for insert c... | Excel Discussion (Misc queries) | |||
How do I change the default color of the tag for insert c... | Excel Discussion (Misc queries) |