Solved

Macro to insert specific row BELOW selected cell

Posted on 2011-02-16
3
527 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

815 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now