Solved

Macro to insert specific row BELOW selected cell

Posted on 2011-02-16
3
531 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 (Microsoft MVP / EE MVE) 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

717 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