+ Reply to Thread
Results 1 to 2 of 2

Add a table to the bottom of a table using a macro

  1. #1
    Registered User
    Join Date
    03-20-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Add a table to the bottom of a table using a macro

    Hi Everyone,

    Please I urgently need your expert advice.

    I recorded a macro to copy and paste a table. However, everytime i press the 'button', it does not paste the new table below the last table pasted but below the original table copied. Please help.


    This is the macro generated but it does not start from below the last table;

    Sub InsertRow()
    '
    ' InsertRow Macro
    '

    '
    Rows("40:75").Select
    Selection.Copy
    ActiveWindow.SmallScroll Down:=6
    Rows("76:76").Select
    Selection.Insert Shift:=xlDown
    Range("A77").Select
    Application.CutCopyMode = False
    End Sub

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Add a table to the bottom of a table using a macro

    Try replacing
    Range("A77").Select
    with
    range("A65536").End(xlUp).offset(2,0).Select

    This assumes you do not go below row 65536. You could take it up to 1,048,576.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

+ 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