A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Discussion (Misc queries)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Insert lines at each change in value



 
 
Thread Tools Display Modes
  #1  
Old December 12th 06, 09:00 PM posted to microsoft.public.excel.misc
LisaVH
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)?
Ads
  #2  
Old December 12th 06, 09:35 PM posted to microsoft.public.excel.misc
Zone
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  
Old December 12th 06, 09:43 PM posted to microsoft.public.excel.misc
LisaVH
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  
Old December 13th 06, 05:04 PM posted to microsoft.public.excel.misc
Zone
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)?

> >
> >


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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:38 AM.


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