Group:  Microsoft Excel ยป microsoft.public.excel.misc
Thread: How do I insert a blank line when category changes

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

How do I insert a blank line when category changes
castleds 27.09.2006 13:35:01
In Excel 2003, I have a spreadsheet with over 1500 rows that I would like to
insert a blank row everytime the category changes in one row.
Re: How do I insert a blank line when category changes
"Don Guillett" <dguillett1[ at ]austin.rr.com> 27.09.2006 13:39:45
for i =cells(rows.count,"a").end(xlup).row to 2 step -1
if cells(i,"a")=categorychange then rows(i).insert
next

--
Don Guillett
SalesAid Software
dguillett1[ at ]austin.rr.com
"castleds" <castleds[ at ]discussions.microsoft.com> wrote in message
news:A2B49DFB-9351-40AB-AB2A-A9DD67ECBB56[ at ]microsoft.com...
[Quoted Text]
> In Excel 2003, I have a spreadsheet with over 1500 rows that I would like
> to
> insert a blank row everytime the category changes in one row.


Re: How do I insert a blank line when category changes
Gord Dibben <gorddibbATshawDOTca> 27.09.2006 20:10:32
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(1, 1).EntireRow.Insert
Next i
With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
End With
End Sub


Gord Dibben MS Excel MVP

On Wed, 27 Sep 2006 06:35:01 -0700, castleds
<castleds[ at ]discussions.microsoft.com> wrote:

[Quoted Text]
>In Excel 2003, I have a spreadsheet with over 1500 rows that I would like to
>insert a blank row everytime the category changes in one row.

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net