ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do you automatically put spaces between rows in a lengthly w. (https://www.excelbanter.com/excel-discussion-misc-queries/18318-how-do-you-automatically-put-spaces-between-rows-lengthly-w.html)

marvaod

How do you automatically put spaces between rows in a lengthly w.
 
I have a lengthly work sheet and I want to put spaces between every row--how
do I do that?

Gord Dibben

Automatically usually involves VBA coding.

Do you really need the inserted rows? Perhaps you could just change the
height of the rows to look double-spaced?

Here is a macro to do the row inserting.

Sub InsertALTrows()
'David McRitchie, misc 2001-06-30
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual 'pre XL97 xlManual
Dim i As Integer
For i = Selection(Selection.Count).Row To Selection(1).Row + 1 Step -1
Rows(i).EntireRow.Insert
'With Rows(i)
' .RowHeight = 24.25
' End With
Next i
Application.Calculation = xlCalculationAutomatic 'pre XL97
xlAutomatic
Application.ScreenUpdating = True
End Sub


Gord Dibben Excel MVP

On Fri, 18 Mar 2005 14:09:01 -0800, "marvaod"
wrote:

I have a lengthly work sheet and I want to put spaces between every row--how
do I do that?



Max

One way ..

Assume your source data is
in Sheet1, in cols A to C, data from row2 down

In Sheet2
--------
Put in A2:

=IF(MOD(ROWS($A$1:A1)-1,2)=1,"",OFFSET(Sheet1!$A$2,MOD(ROWS($A$1:A1)-1,2)+IN
T((ROWS($A$1:A1)-1)/2),COLUMNS($A$1:A1)-1))

Copy A2 across to C2, fill down until zeros appear, signalling exhaustion of
data from Sheet1

The above will return what you want
(insert alternating blank rows in-between the data from Sheet1)

Do a copy and paste special as values elsewhere as desired

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"marvaod" wrote in message
...
I have a lengthly work sheet and I want to put spaces between every

row--how
do I do that?





All times are GMT +1. The time now is 01:35 AM.

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