+ Reply to Thread
Results 1 to 4 of 4

Need help with a macro to add lines at the bottom of a table

  1. #1
    Registered User
    Join Date
    01-15-2014
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    8

    Need help with a macro to add lines at the bottom of a table

    I need help with a macro to add a specific number of lines to the bottom of a table. I currently have this:


    NoRows = InputBox("How many rows?")
    Rows(Range("A" & Rows.Count).End(xlUp).Row).Resize(NoRows).Insert


    which is able to add a variable number of rows, based on user input, but it adds the rows at the first from the bottom, rather than the bottom.

    Any help would be appreciated.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Need help with a macro to add lines at the bottom of a table

    Hi Arcadia,

    Please review rule #3 on the forum rules regarding code tags. That said, change your code to this:

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    01-15-2014
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: Need help with a macro to add lines at the bottom of a table

    Apologies for the lack of code tag.

    The +1 addition to the code does make it add below, but it adds outside of the table, rather than at the bottom of the table. Maybe I need to resize the table (based on user input), rather than add to it?

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Need help with a macro to add lines at the bottom of a table

    I'm not sure how to add more than one row at a time using the listrow method, but using a little loop this should work:

    Please Login or Register  to view this content.
    I should have elaborated... Change the sheet and table name in the code of course.
    Last edited by Arkadi; 08-18-2016 at 02:38 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 02-25-2015, 10:38 AM
  2. Clear List Macro for Data Validation, Multiple Lines in table
    By gedwards913 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2014, 04:42 PM
  3. Macro to close table with Bottom line
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-15-2014, 03:43 AM
  4. Add a table to the bottom of a table using a macro
    By bukkibams in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-21-2013, 11:39 AM
  5. Add a row to the bottom of a table using a macro?
    By MilkyQuail in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-21-2013, 10:35 AM
  6. inserting serveral lines into an table with macro
    By Jszota in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2011, 02:01 PM
  7. Run A Macro Against a Table Until it gets to bottom
    By racer25 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-04-2005, 12:22 PM

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