• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

how to insert rows

i mean with insert function, i am able to insert one row above the selected row. but what i need is inserting empty/blank rows in between a range of selected rows. pls help
 
silparupa

Add the following to a code module in VBA

To use assign the macro to a Button or Shape on your page

select a cell within the range you want to Insert Rows


Say you have data from Row 10:20 and have a blank row at Row 9

Select anywhere in Rows 10 to 20


Run the macro

[pre]
Code:
Sub Insert_Blank_Rows()

Selection.End(xlDown).Select
While ActiveCell.Offset(-1, 0).Value <> ""
ActiveCell.EntireRow.Insert shift:=xlDown  'Insert blank row.
ActiveCell.Offset(-1, 0).Select  'Move up one row.
Wend

End Sub
[/pre]
 
Hello


Not sure if the above solved your problem but if you want to insert multiple rows you can still use the insert row function.


If you want 10 rows inserting you can highlight a column of 10 cells below where you want the new rows and then use the insert sheet rows from the ribbon.


Or you can use the keyboard shortcut Shift + Space to highlight the row that you want to insert cells above, then using shift + down arrow you can add to the number of rows highlighted - if you highlight 10 then you will insert 10 by pressing


ALT + I followed by E


You can then use F4 to repeat if you wanted to insert another 10 straight away.


Hope this helps


Wilson
 
Back
Top