+ Reply to Thread
Results 1 to 8 of 8

DO NOT Copy Data Under Table/ Copy Data from Table to Table

  1. #1
    Forum Contributor
    Join Date
    08-04-2018
    Location
    San Dieg CA
    MS-Off Ver
    Microsoft Office Professional Plus 2016 (Excel 2016 MSO 32 bit)
    Posts
    167

    DO NOT Copy Data Under Table/ Copy Data from Table to Table

    Hello Everyone,

    As always, any assistance is greatly appreciated! In the workbook, I have to sheets (sheet1 and sheet2) and a button. When clicked, every row in Sheet1 with the cell value ?Complete? is deleted and copied to Sheet2. The data is in tables (Table1 and Table2). The problem is when it copies over, it doesn?t remain in a table format, but rather copies the data under the table. What I want is for the data to copy from table to table. I?ve attached the sample workbook. also posted in VBAExpress: http://www.vbaexpress.com/forum/memb...79150-rorobear

    Thank you again!
    roro

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,050

    Re: DO NOT Copy Data Under Table/ Copy Data from Table to Table

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Contributor
    Join Date
    08-04-2018
    Location
    San Dieg CA
    MS-Off Ver
    Microsoft Office Professional Plus 2016 (Excel 2016 MSO 32 bit)
    Posts
    167

    Re: DO NOT Copy Data Under Table/ Copy Data from Table to Table

    Thank you very for coming to my assistance. The code doesn't seem to be working. when i press the "Delete Completed Tasks: button i get the following error: Run-time error '91: Object variable or with block variable not set.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,050

    Re: DO NOT Copy Data Under Table/ Copy Data from Table to Table

    Try:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-04-2018
    Location
    San Dieg CA
    MS-Off Ver
    Microsoft Office Professional Plus 2016 (Excel 2016 MSO 32 bit)
    Posts
    167

    Re: DO NOT Copy Data Under Table/ Copy Data from Table to Table

    another error, Run-time error '1004: Delete method of Range failed

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,050

    Re: DO NOT Copy Data Under Table/ Copy Data from Table to Table

    The macro works properly for me using the file you posted. Are you using it on the same file as you posted? If not, post a copy of the file that is generating the error.

  7. #7
    Forum Contributor
    Join Date
    08-04-2018
    Location
    San Dieg CA
    MS-Off Ver
    Microsoft Office Professional Plus 2016 (Excel 2016 MSO 32 bit)
    Posts
    167

    Re: DO NOT Copy Data Under Table/ Copy Data from Table to Table

    I'm using the same file, i've even tried creating a new file from scratch and the same thing happens. it's okay, Sheet2 just won't have a Table. Thank you agian, i really appreciate it.

  8. #8
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,543

    Re: DO NOT Copy Data Under Table/ Copy Data from Table to Table

    The probable cause of the problems is the disabled automatic expanding of the table.

    If it was turned off accidentally, you can use the code below to turn it back on (You can find it manually in the autocorrect settings).
    Please Login or Register  to view this content.
    But be careful. You may have workbooks that require this option to be disabled. This setting works globally, that is, it is not tied to a single workbook.

    The following code does not interfere with the described setting. In principle, this is how we should write code that appends new rows to a table, especially when we have no control over the environment in which the code is run.
    Please Login or Register  to view this content.
    Of course, it is assumed that there are tables in both sheets.

    Artik

+ 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. Copy specific data from one table to another table, depending on date
    By xltlp in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-26-2021, 07:29 PM
  2. Macro to search through table and copy all rows with data into another table
    By DaBestEva in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-03-2020, 10:29 AM
  3. [SOLVED] Copy paste data from table to another table then delete data without losing formulas
    By dps9460 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2019, 03:14 AM
  4. Replies: 3
    Last Post: 10-23-2017, 08:37 PM
  5. Replies: 0
    Last Post: 11-06-2014, 07:25 PM
  6. Replies: 1
    Last Post: 11-28-2013, 02:10 AM
  7. Macro to Copy Pivot Table and Paste a Regular Data Table in the Same Position
    By webfeet2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-01-2013, 06:34 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