• 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.

Insert banded blank rows in a selected range(VBACode)

vijay.vizzu

Member
Dear All,


I need VBA Code, to insert banded blank rows in a selected range. Assume that i need to insert row between 3 to 10, then i need to do manaully by selecting the rows with ctrl button and insert the rows. So please give me VBA code so that it will be inserted blank rows below on selected range.


Thanks in advance.
 
Hello Vijay.vizzu,


Two ways to do so :


1/ Use the Macro recorder (Menu Developer/Record Macro), once started do exactly what you described.

Then press ALT+F11, search from module1 you'll see the VBA code of this macro.


2/ With the Range object, assuming you want to insert X lines below the 3rd row of your selection ("A:G")

[pre]
Code:
Range("A:G").Rows(3).Insert xlShiftDown
[/pre]

X times (in a loop for instance).


Regards
 
Back
Top