Link to home
Start Free TrialLog in
Avatar of Jass Saini
Jass Saini

asked on

Excel Marco to insert rows

Hello..it's been a while since   I want to write a marco that insert 27 rows???
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

Assuming you want to insert rows at row-1 i mean above it you can do something like this...

Sub insertrows()
    Dim i As Long, rw As Long

    rw = 1

    For i = 1 To 27
        Rows(rw).Insert
    Next i

End Sub

Open in new window


Saurabh...
Avatar of Phillip Burton
Phillip Burton

Rows("1:27").Insert
Avatar of Jass Saini

ASKER

Hello...that will only do row 1...to row 27..

i want to be able to click in the worksheet and insert 27 blank rows.  Sorry about the confusion
Okay what i understand you want to insert manually blank rows?? or you want to insert it programmatically on a particular row..? What you want to do??
I know how to do it manually...but is there a way to just click and Crtl something and have keep inserting 27 blank rows?
ASKER CERTIFIED SOLUTION
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
So there is no way to do with one click
Thank you on the other shortcut
Nope..Either you need to do action 27 times or you need to select 27 rows first and then do it 1 time like Matin Posted..Up-to you which way you want to do it..
Thank you..