+ Reply to Thread
Results 1 to 3 of 3

Trying to copy a row from one table into another table

  1. #1
    Registered User
    Join Date
    12-11-2016
    Location
    Barton Upon Humber, England
    MS-Off Ver
    Office 365 Desktop
    Posts
    8

    Smile Trying to copy a row from one table into another table

    Hi

    Can someone help please before I go crazy.

    I am a frustrated beginner, who has spent the last two days trying to copy a row selected from one table in a sheet to another table in a second sheet.
    I have tried many different examples obtained from the internet, but nothing seems to work for me.
    from a form I am trying to select organisation's matching a form text field and copy the matching search results into another table, which I clear down before the search process.
    The table headers and number of columns in both my tables are an exact copy of each other.
    Sheet "Organisation" contains the table "tblOrganisation" this is used for my form field comparison on column 2 of the table.
    Sheet "OrgSearch" contains the table "tblOrgSearch" which should contain all rows found in the table "tblOrganisation".
    The code I am currently trying gives me the first matching row but does not include the next two matching rows that I was expecting.
    Using msgbox I have tested the selection process and that is working ok! I just cannot get all the rows across to the table "tblOrgSearch"

    I am sure there is a better way of coding my solution, I have tried ListObjects etc. but got nowhere.
    p.s. sorry for all the comments in my code, gone a bit overboard, but it helps when you have a problem.

    To use the spreadsheet, the spreadsheet opens displaying the main form "frmMain" it's on this form that I have the above problem:
    I type 'ort' in the 'Search by Organisation' field and click on the 'Search' button, it should display the results in the listbox below.
    To see the work sheets etc click on the 'x' cancel button and type the password 'xyz', then click on the display sheets button to get access to the worksheets and code.

    I am still developing this spreadsheet so a lot of code is still missing and it is not fully tested.

    I dumped my original code and replaced it with this new code. which NOW WORKS


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by papashep; 12-08-2020 at 08:33 AM. Reason: I solved my problem

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Trying to copy a row from one table into another table

    Any chance you can provide a file, as per the yellow banner above, so that we can troubleshoot the issue

  3. #3
    Registered User
    Join Date
    12-11-2016
    Location
    Barton Upon Humber, England
    MS-Off Ver
    Office 365 Desktop
    Posts
    8

    Re: Trying to copy a row from one table into another table

    Hi
    I have done what you requested, keep in mind I am a beginner with excel vba, forms and tables.
    Papashep

+ 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. Help with table - Copy rows, delete rows, reset table & copy table
    By gkpbydesign in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-15-2019, 10:30 AM
  2. [SOLVED] Macro To copy information in a table (keeping format and nested table intact)
    By meabrams in forum Word Programming / VBA / Macros
    Replies: 6
    Last Post: 03-29-2017, 03:20 AM
  3. Replies: 0
    Last Post: 11-06-2014, 07:25 PM
  4. macro to copy table from sheet1 to sheet2 (# of rows in table may vary everytime)
    By arkharova.s in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2014, 03:18 AM
  5. 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
  6. Replies: 2
    Last Post: 05-07-2012, 04:24 AM
  7. Replies: 1
    Last Post: 05-04-2012, 03:10 PM

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