ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Insert blank line macro (https://www.excelbanter.com/excel-worksheet-functions/83357-insert-blank-line-macro.html)

laidebug

Insert blank line macro
 
Can someone tell me how to write a macro that inserts a blank line between a
column of data? I have 100 lines of names and I want a blank line in between
them all. Thanks!

Paul B

Insert blank line macro
 
laidebug, here is one way,

Sub insert_row()
'will insert a row between each row from A1:A100
Application.ScreenUpdating = False
For i = 100 To 1 Step -1
Cells(i, "A").EntireRow.Insert
Next i
Application.ScreenUpdating = True
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"laidebug" wrote in message
...
Can someone tell me how to write a macro that inserts a blank line between

a
column of data? I have 100 lines of names and I want a blank line in

between
them all. Thanks!





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

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