ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   HOW CAN I AUTOMATICALLY INSERT ALTERNATE BLANK ROWS IN A LIST? (https://www.excelbanter.com/excel-discussion-misc-queries/22629-how-can-i-automatically-insert-alternate-blank-rows-list.html)

Phil A.

HOW CAN I AUTOMATICALLY INSERT ALTERNATE BLANK ROWS IN A LIST?
 
I have a standard list in Excel and I want to insert multiple alternate
blank rows automatically so that these rows can be used for additiional data
at a later stage.

Can anyone offer advice as to how this can be done?

Thanks in advance.

Gord Dibben

Phil

"Automatic" requires VBA code.

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

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to ToolMacroMacros.


Gord Dibben Excel MVP



On Tue, 19 Apr 2005 06:55:03 -0700, "Phil A." <Phil
wrote:

I have a standard list in Excel and I want to insert multiple alternate
blank rows automatically so that these rows can be used for additiional data
at a later stage.

Can anyone offer advice as to how this can be done?

Thanks in advance.




All times are GMT +1. The time now is 03:07 PM.

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