+ Reply to Thread
Results 1 to 3 of 3

Button (or Macro) to insert a row

  1. #1
    Registered User
    Join Date
    03-24-2011
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2007
    Posts
    35

    Button (or Macro) to insert a row

    Hi,

    I'm sure this query has been posted many times so apologies for any repeats. I'm new to creating Macros in Excel. I want to create a simple button that will insert a row in between two rows. For instance, if the table contained the following....

    Row A Name Surname Location
    Row B John Smith England
    Row C Joe Bloggs USA

    etc...

    ... i'm hoping to press a button that would insert a row between Row A and Row B allowing me to make another entry under the headings in Row A. Any is help is appreciated.

    Thanks.
    Last edited by raza_m33hdy; 10-17-2011 at 08:00 PM.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Button (or Macro) to insert a row

    Place a form button in your spreadsheet. Open a new code module and paste in this code:
    Please Login or Register  to view this content.
    Right click your button in the spreadsheet, and then click assign macro. Assign the macro InsertRow.
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Registered User
    Join Date
    03-24-2011
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Button (or Macro) to insert a row

    Thanks for this. Worked like a charm. Also, how do I make the button stay in one place? as every time I click it, the button keeps moving down as it adds another row.

    Thanks once again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1