+ Reply to Thread
Results 1 to 3 of 3

Copy columns from table1 to table2

  1. #1
    Registered User
    Join Date
    04-24-2020
    Location
    USA
    MS-Off Ver
    WA
    Posts
    64

    Copy columns from table1 to table2

    Hi experts,

    I need some assistance on this sample file. I have table1 in sheet1 and table2 in sheet2. I would like o copy column A and D if column D has "InActive" value. And after copying to table2, I like those rows to be deleted from table1.

    Thank you!
    Attached Files Attached Files

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

    Question Re: Copy columns from table1 to table2


    Hi,

    at Excel very beginner level - so without any code ! - just operating Excel basics like for example a filter …
    So a VBA procedure is really really needed ?

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

    Cool Try this …


    According to your attachment as a VBA starter :

    PHP Code: 
    Sub Demo1()
              Const 
    "InActive"
                
    Dim Rg As Range
        With Sheet1
    .ListObjects(1)
            If 
    IsNumeric(Application.Match(C, .Range.Columns(4), 0)) Then
                Application
    .ScreenUpdating False
            With Sheet2
    .ListObjects(1).ListColumns(1).Range.Rows
                Set Rg 
    = .Cells(.Rows.Count)(IsEmpty(.Cells(.Rows.Count)))
            
    End With
               
    .Range.AutoFilter 4C
                Union
    (.DataBodyRange.Columns(1), .DataBodyRange.Columns(4)).Copy Rg
               
    .DataBodyRange.EntireRow.Delete
               
    .Range.AutoFilter 4
                Application
    .ScreenUpdating True
                Set Rg 
    Nothing
            End 
    If
        
    End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

+ 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. Populate and rezise table2 as table1 changes
    By Dresas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2017, 01:03 PM
  2. [SOLVED] How to convert uploaded table1 to table2?
    By tta.akmal in forum Excel General
    Replies: 5
    Last Post: 04-16-2017, 08:04 AM
  3. If-Then copying specific data from Table1 to Table2 in a specific order
    By b4tmast in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2016, 04:28 AM
  4. [SOLVED] Displaying a column from table2 based on a filter in table1
    By FVMLABOLG in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-06-2015, 04:58 PM
  5. Copy TABLE1 ROW from one sheet to TABLE2 LAST ROW in another sheet
    By jigneshwaghela07 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-02-2014, 08:51 AM
  6. Copy TABLE1 ROW from one sheet to TABLE2 LAST ROW in another sheet
    By jigneshwaghela07 in forum Hello..Introduce yourself
    Replies: 0
    Last Post: 06-01-2014, 12:56 PM
  7. How to copy Table2 columns in to Table1 ?
    By bsaimsc in forum Access Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2012, 07:13 AM

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