+ Reply to Thread
Results 1 to 6 of 6

Copy range and paste to listobjects

  1. #1
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Copy range and paste to listobjects

    hi,

    I need to copy range A2:B upto last row from Source worksheet (SOA) and paste to last row to the destination (Worksheet) table1 and also do the same process from D2:Q upto last row.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy range and paste to listobjects

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Copy range and paste to listobjects

    Thank you Alpha, works perfectly. Can you please add on more line to sort Column B.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy range and paste to listobjects

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this …


    As a beginner starter :

    PHP Code: 
    Sub Demo1()
             
    Dim R&
        
    With Sheet1.ListObjects(1)
                 
    = .TotalsRowRange.Row
                
    .Resize .Range.Resize(+ .ListRows.Count Sheet2.UsedRange.Rows.Count)
            
    With Sheet2.UsedRange.Rows("2:" Sheet2.UsedRange.Rows.Count).Columns
                
    .Item("A:B").Copy Sheet1.Cells(R1)
                .
    Item("C:Q").Copy Sheet1.Cells(R4)
            
    End With
                
    .Range.Sort .Range(12), xlAscendingHeader:=xlYes
        End With
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  6. #6
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Copy range and paste to listobjects

    Thank You Alpha, Excellent. As you have converted Column B into Date Format, now I don't need that additional Column C. I will amend the code. Solved..

+ 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. For each Table in ActiveSheet.ListObjects (Copy TableHeader) How?
    By nordicdust in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-30-2018, 12:05 PM
  2. Copy multiple listobjects and change name
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2018, 04:07 PM
  3. excel vba - Copy specific rows/columns from one ListObjects to another
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2018, 11:43 AM
  4. [SOLVED] Help! - Copy Range (Sheet1,A10:F50), Paste Range (Sheet 2,A1:F41), Offset Range & Repeat
    By cjtimmer in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-30-2015, 06:27 PM
  5. Me.ListObjects("tblName").DataBodyRange.Rows.Delete - Does Me Not Like ListObjects?
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-30-2014, 01:56 PM
  6. How do you use the ListObjects property of the range object?
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2013, 05:48 PM
  7. ListObjects in a Variable Range
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-26-2010, 06:53 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