ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to automatically insert blank lines in between non-blank lines (https://www.excelbanter.com/excel-programming/282744-how-automatically-insert-blank-lines-between-non-blank-lines.html)

No Name

how to automatically insert blank lines in between non-blank lines
 
as subject, thanks.




Chip Pearson

how to automatically insert blank lines in between non-blank lines
 
Try something like the following. Change the StartRow and EndRow to the
appropriate values.

Sub AAA()
Dim Ndx As Long
Dim StartRow As Long
Dim EndRow As Long
StartRow = 1 '<<< CHANGE
EndRow = 10 '<<< CHANGE
For Ndx = EndRow To StartRow Step -1
Rows(Ndx).Insert
Next Ndx
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


wrote in message
...
as subject, thanks.






No Name

how to automatically insert blank lines in between non-blank lines
 
lots of thanks.


"Chip Pearson" ¼¶¼g©ó¶l¥ó·s»D
...
Try something like the following. Change the StartRow and EndRow to the
appropriate values.

Sub AAA()
Dim Ndx As Long
Dim StartRow As Long
Dim EndRow As Long
StartRow = 1 '<<< CHANGE
EndRow = 10 '<<< CHANGE
For Ndx = EndRow To StartRow Step -1
Rows(Ndx).Insert
Next Ndx
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


wrote in message
...
as subject, thanks.










All times are GMT +1. The time now is 01:31 PM.

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