+ Reply to Thread
Results 1 to 2 of 2

Add row to end of table and resize table automatically

  1. #1
    Registered User
    Join Date
    07-02-2012
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2007
    Posts
    1

    Add row to end of table and resize table automatically

    Hi, I'm having issues resizing the table after I add a row to the end of it...any help is appreciatted.

    VB:

    Sub Add_Row()
    '
    '
    ' Definitions
    Dim r As Integer

    ' Unhide Key sheet
    Sheets("Tradeflow List").Select
    Sheets("Key").Visible = True

    ' Count number of rows
    r = 0 'initialize rows
    r = Range("Table1").End(xlDown)

    ' Copy and paste master row
    Sheets("Key").Select
    Rows("186:186").Select
    Selection.Copy
    Sheets("Tradeflow List").Select
    Range("Table1").End(xlDown).Offset(1).Select
    Selection.Insert Shift:=xlDown

    ' Hide Key sheet
    Application.CutCopyMode = False
    Sheets("Key").Visible = False

    ' Resize Table1
    Range("Table1").resize (r + 1)
    Range("Table1").Select

    End Sub

    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Add row to end of table and resize table automatically

    attach a sample file for testing
    If solved remember to mark Thread as solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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