+ Reply to Thread
Results 1 to 4 of 4

Automate data transfer from sheet 1 to sheet 2.

  1. #1
    Registered User
    Join Date
    08-12-2019
    Location
    UK
    MS-Off Ver
    2016
    Posts
    6

    Automate data transfer from sheet 1 to sheet 2.

    Greetings everyone,

    I have an Excel file with a number of worksheets but there are just two that I'm hoping someone could help me with in moving "not equal to" data from sheet 1 to sheet 2.

    I have attached a sample workbook which hopefully is enough for you to follow what I would like to do. There are sixteen columns of data but the number of rows will vary, rarely more than 150 rows.

    In sheet 1, cell A1 there is a data validation drop down list with various Counties listed (in the sample, these are just named CTY1, CTY2, CTY3 etc...........).
    When a selection is made from the drop down, how could I automate the transfer of each row of data of those Counties which do not equal the selection. For example, if, in the sample, I select CTY1 then the data of all the other Counties (CTY2 to CTY8) is transferred to sheet 2 (CTY1 is excluded).

    Thank you to anyone who may take an interest in my little query.

    Regards,
    Leela.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Automate data transfer from sheet 1 to sheet 2.

    Hello Leela,

    Automating the AutoFilter would be a good way of doing this task but seeing that your data set is not overly large, the ColumnDifferences method should do the task efficiently for you using an event code, placed in the Sheet1 module:-

    Please Login or Register  to view this content.
    This code will also transfer the headings over for you and Sheet 2 is cleared prior to any data transfer (I'm assuming that you want to keep the data in Sheet1).

    To implement this code:-

    - Right click on the Sheet1 tab.
    - Select "View Code" from the menu that appears.
    - In the big white code field that then appears, paste the above code.

    I hope that this helps.

    Cheerio,
    vcoolio.

    P.S. Sorry Leela. I meant to add a little more info for you. Basically, when you make a selection from the drop down list, the event code will automatically trigger and transfer all rows of data of the Counties not equal to the selection. No button is required.
    Last edited by vcoolio; 06-22-2021 at 12:42 AM. Reason: Add P.S.

  3. #3
    Registered User
    Join Date
    08-12-2019
    Location
    UK
    MS-Off Ver
    2016
    Posts
    6

    Re: Automate data transfer from sheet 1 to sheet 2.

    Hi vcoolio,

    Thank you so much for helping me with this. The code works perfectly!

    Regards,
    Leela.

  4. #4
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Automate data transfer from sheet 1 to sheet 2.

    You're welcome Leela. Glad to have been able to assist.

    Cheerio,
    vcoolio.

+ 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. How to automate transfer of data from masterfile to another sheet based on model no.
    By CanCanKen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2017, 04:47 AM
  2. [SOLVED] Transfer data from sheet to other sheet, protecting the second sheet.
    By Markcassar123 in forum Excel General
    Replies: 4
    Last Post: 06-25-2015, 02:05 AM
  3. [SOLVED] Issue regarding recorded Macro to transfer data from Input sheet to Storage sheet
    By Hirad001 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-29-2015, 04:26 PM
  4. How to transfer data from a daily input sheet to a separate monthly total sheet
    By Jcooper71 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2014, 02:37 PM
  5. Transfer inputed Data from Sheet x: row x to Sheet y : row y or Sheet z: row z
    By Joecruz749 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-04-2013, 03:20 PM
  6. Replies: 1
    Last Post: 02-13-2013, 01:32 PM
  7. Automate transfer Data to a sheet
    By vaikz in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-02-2009, 12:12 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