Solved

Macro to insert specific row BELOW selected cell

Posted on 2011-02-16
3
529 Views
Last Modified: 2012-08-13
Hello,

I was wondering if someone can please have a look at the attached file and fix my little macro accordingly?
Currently it is inserting above the selected/highlighted cell whereas i need it to insert below instead.
The macro is called 'InsertRow'

Any help / suggestions will be greatly appreciated, as you can see i am very new at this!      example.xlsm
0
Comment
Question by:vegas86
  • 2
3 Comments
 

Author Comment

by:vegas86
ID: 34912410
sorry i forgot to attach the file!
example.xlsm
0
 
LVL 50

Accepted Solution

by:
Ingeborg Hawighorst earned 500 total points
ID: 34912471
Hello,

change these two lines of code from

    Selection.EntireRow.Insert
     
    iRow = ActiveCell.Row

to this


    Selection.Offset(1, 0).EntireRow.Insert
     
    iRow = ActiveCell.Row + 1


cheers, teylyn
0
 

Author Closing Comment

by:vegas86
ID: 34912564
Thank you SO much for the fast reply Teylyn I did what you suggested and it works a treat! you are a gem!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question