Insert blank lines in Excel Document macro
Posted by nonenas on Dec 8th, 2007
2007
Dec 8
Isn’t it irritating when you need to insert multiple blank lines somewhere in an excel document and you have to keep pressing insert->Lines?
The following code asks the user how many blank lines he would like to add before the cell he has selected and inserts them.
Sub add_lines()
Dim number As String
number = InputBox("How many lines would you like to add?")
For i = 1 To CInt(number)
Selection.EntireRow.Insert
Next i
End Sub