ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   excel - auto spacing (https://www.excelbanter.com/excel-discussion-misc-queries/75010-excel-auto-spacing.html)

Jerry Schlick

excel - auto spacing
 
is there a way to do an auto spacing in excel. When I have a large amount of
data.

See example

Aby Abraham Moozikkal-91997 02/23/06 7:43AM EST
Aby Abraham Moozikkal-91997 02/23/06 8:18AM EST
Aditha Suresh Bhatia 02/01/06 1:02AM EST
Aditha Suresh Bhatia 02/01/06 1:07AM EST

Is there a way to have excel insert either 1 or 2 blank lines

Aby Abraham Moozikkal-91997 02/23/06 7:43AM EST
Aby Abraham Moozikkal-91997 02/23/06 8:18AM EST

Aditha Suresh Bhatia 02/01/06 1:02AM EST
Aditha Suresh Bhatia 02/01/06 1:07AM EST

This would save me a huge amount of time on a monthy report I have to compile



Gord Dibben

excel - auto spacing
 
Jerry

Can you go with a macro that inserts 1 blank row at each change in data in
Column A?

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
' Resize(2,1) for 2 blank rows
Next i
With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
End With
End Sub


Gord Dibben MS Excel MVP

On Thu, 2 Mar 2006 18:44:26 -0800, Jerry Schlick <Jerry
wrote:

is there a way to do an auto spacing in excel. When I have a large amount of
data.

See example

Aby Abraham Moozikkal-91997 02/23/06 7:43AM EST
Aby Abraham Moozikkal-91997 02/23/06 8:18AM EST
Aditha Suresh Bhatia 02/01/06 1:02AM EST
Aditha Suresh Bhatia 02/01/06 1:07AM EST

Is there a way to have excel insert either 1 or 2 blank lines

Aby Abraham Moozikkal-91997 02/23/06 7:43AM EST
Aby Abraham Moozikkal-91997 02/23/06 8:18AM EST

Aditha Suresh Bhatia 02/01/06 1:02AM EST
Aditha Suresh Bhatia 02/01/06 1:07AM EST

This would save me a huge amount of time on a monthy report I have to compile



Jerry Schlick

excel - auto spacing
 
AWESOME it worked perfectly.

Thanks for the help

Jerry

"Gord Dibben" wrote:

Jerry

Can you go with a macro that inserts 1 blank row at each change in data in
Column A?

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
' Resize(2,1) for 2 blank rows
Next i
With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
End With
End Sub


Gord Dibben MS Excel MVP

On Thu, 2 Mar 2006 18:44:26 -0800, Jerry Schlick <Jerry
wrote:

is there a way to do an auto spacing in excel. When I have a large amount of
data.

See example

Aby Abraham Moozikkal-91997 02/23/06 7:43AM EST
Aby Abraham Moozikkal-91997 02/23/06 8:18AM EST
Aditha Suresh Bhatia 02/01/06 1:02AM EST
Aditha Suresh Bhatia 02/01/06 1:07AM EST

Is there a way to have excel insert either 1 or 2 blank lines

Aby Abraham Moozikkal-91997 02/23/06 7:43AM EST
Aby Abraham Moozikkal-91997 02/23/06 8:18AM EST

Aditha Suresh Bhatia 02/01/06 1:02AM EST
Aditha Suresh Bhatia 02/01/06 1:07AM EST

This would save me a huge amount of time on a monthy report I have to compile





All times are GMT +1. The time now is 10:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com