+ Reply to Thread
Results 1 to 3 of 3

VBA to add data to a table

  1. #1
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    VBA to add data to a table

    Hello: I am trying to add data from sheet 1 to a table in sheet two. The reason is that I am trying to generate an automatically updated pivot which is possible with a table. The data in sheet 1 is being populated from another source . I am trying to get data from sheet 1 to keep pasting in a table in sheet 2 in the next empty row. Then I have a pivot in sheet 3 which will auto populate the additions. I am using excel 2007.

    Thanks in advance for your help

  2. #2
    Forum Contributor
    Join Date
    11-04-2011
    Location
    pak
    MS-Off Ver
    Excel 2007
    Posts
    132

    Re: VBA to add data to a table

    hello,

    here is the code, assuming that your source data column start at cell B2 always, and destination column is G, then it will search empty row in G and paste the data

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-20-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007, Excel 2003, Excel 2010
    Posts
    284

    Re: VBA to add data to a table

    Thanks. I was trying to edit the " Range(("Table3[#All]").End(xlUp).Row + 1).Select" to paste the data in the row after the last entry. I keep getting an error message when i try to execute.


    Sheets("Data").Select
    Range("A3:AD15").Select
    Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    Selection.Copy
    Sheets("Consolidated Data").Select
    Range(("Table3[#All]").End(xlUp).Row + 1).Select
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
    xlNone, SkipBlanks:=False, Transpose:=False
    Last edited by rlsublime; 11-22-2011 at 03:44 PM.

+ 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