Results 1 to 5 of 5

Add data to the next available row in an Excel table

Threaded View

  1. #1
    Registered User
    Join Date
    03-11-2020
    Location
    Vancouver
    MS-Off Ver
    Office 365
    Posts
    3

    Add data to the next available row in an Excel table

    Hi there,

    I am looking to add data from one sheet to another using vba code.

    Here's what I have so far:

    Sub Test()
    
    Sheets("Correspondence Log").Select
    
    ProjectComponent = Range("B2").Value
    
    Originator = Range("C2").Value
    
    DocumentType = Range("D2").Value
    
    Discipline = Range("E2").Value
    
    Title = Range("F2").Value
    
    
    
    Sheets("Database").Select
    
    Set ws = ActiveSheet
    
    Dim newrow As ListRow
    
    Set newrow = ws.ListObjects("frmFileListDS").ListRows.Add
    
    
    With nextrow
    
        .Range(1) = ProjectComponent
        .Range(2) = Originator
        .Range(3) = DocumentType
        .Range(4) = Discipline
        .Range(7) = Title
        
    
    End With
    
    
    End Sub
    This code works to add code to the end of an excel table but how can I add this data to the next available row?

    Any help would be gratly appreciated!
    Last edited by Pepe Le Mokko; 03-11-2020 at 01:26 PM. Reason: Code tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 09-08-2017, 07:30 AM
  2. Hardcopy list generated by Excel's Data Table, refresh table and repeat
    By Ronnet2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-27-2015, 06:24 AM
  3. Replies: 0
    Last Post: 11-06-2014, 07:25 PM
  4. Replies: 3
    Last Post: 01-07-2014, 06:13 AM
  5. Replies: 2
    Last Post: 06-16-2013, 02:58 PM
  6. Export Excel data into Access table - overwrite table data
    By Jonsocks in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-08-2012, 12:05 PM
  7. import data from access table to excel pivot table - Enable Auto Refresh
    By okl in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 02-01-2010, 09:38 AM

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