+ Reply to Thread
Results 1 to 27 of 27

Transfer data from one worksheet to another based on criteria

  1. #1
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Transfer data from one worksheet to another based on criteria

    Hi
    I wanted to transfer data from TEST 1 to TEST 2 workbook based on the criteria in TEST 2 workbook. Sample workbooks uploaded.
    I am not sure if this is possible. At least the data transfer in specific date range (criteria- Date) will also be helpful.

    Many thanks for your kind help!
    Attached Files Attached Files
    Last edited by ash2017; 04-13-2017 at 12:37 PM.

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Transfer data from one worksheet to another based on criteria

    Hi ash2017

    Help us understand what you are trying to achieve...
    Are you wanting to enter information into the blocks and then pressa button for it to be entered into the rows under appropriate headers on other sheet?
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    Hi Sintek,
    Yes, you are right.
    Many thanks

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Transfer data from one worksheet to another based on criteria

    Try the following formula in A16 of Test2. It should be array-entered (confirm with Ctrl + Shift + Enter instead of Enter):

    =IFERROR(INDEX('[TEST 1.xlsx]Tracker'!$A$3:$A$11,SMALL(IF((IF($B$1="",1,$B$1='[TEST 1.xlsx]Tracker'!$B$3:$B$11))*(IF($B$3="",1,$B$3='[TEST 1.xlsx]Tracker'!$C$3:$C$11))*(IF($B$5="",1,$B$5='[TEST 1.xlsx]Tracker'!$F$3:$F$11))*(IF($B$7="",1,$B$7<='[TEST 1.xlsx]Tracker'!$G$3:$G$11))*(IF($D$7="",1,$D$7>='[TEST 1.xlsx]Tracker'!$G$3:$G$11))*(IF($B$9="",1,$B$9='[TEST 1.xlsx]Tracker'!$H$3:$H$11))*(IF($B$11="",1,$B$11<='[TEST 1.xlsx]Tracker'!$I$3:$I$11))*(IF($D$11="",1,$D$11>='[TEST 1.xlsx]Tracker'!$I$3:$I$11))*(IF($B$13="",1,$B$13='[TEST 1.xlsx]Tracker'!$J$3:$J$11))=1,ROW('[TEST 1.xlsx]Tracker'!$A$3:$A$11)),ROW(1:1))-2),"")

    This should return the SI number of entries that match the criteria. You can then use a regular look up to get the rest of the data. Enter the following (non-array) in B16:

    =IFERROR(INDEX('[TEST 1.xlsx]Tracker'!B$3:B$11,MATCH($A16,'[TEST 1.xlsx]Tracker'!$A$3:$A$11,0)),"")

    Fill right through J16, then fill everything down. Make sure the file path matches. It would help if you have them both open when you first enter the equation. It appears to be working for me, but give it a try to see if it will do.
    If your problem has been solved, please use "Thread Tools" to mark the thread as "Solved".

    If you're grateful for this site's existence and would like to contribute to the community, please consider posting something hilarious in our joke thread:
    https://www.excelforum.com/the-water...ke-thread.html

  5. #5
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    Hi CAntosh,
    Thank you. Actually I am looking for VBA code

  6. #6
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Transfer data from one worksheet to another based on criteria

    Quote Originally Posted by ash2017 View Post
    Hi Sintek,
    Yes, you are right.
    Many thanks
    Is this a client query log list that you will be working on....So will need to be edited daily etc.

  7. #7
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    Quote Originally Posted by sintek View Post
    Is this a client query log list that you will be working on....So will need to be edited daily etc.
    Yes the data will be included in TEST 1 everyday. TEST 2 will only populate rows from TEST 1 based on criteria.

  8. #8
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Transfer data from one worksheet to another based on criteria

    K, what criteria....Edited.

    k so Date criteria I see....So what, if certain date do what?

  9. #9
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    Quote Originally Posted by sintek View Post
    K, what criteria
    Client ref no.

    Issue type Technical

    Initial/Follow-up Initial

    Date 3-Apr-17 to 4-Apr-17

    Resolved (Y/N) Yes

    Date of resolution to

    On time (Y/N) Yes

  10. #10
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Transfer data from one worksheet to another based on criteria

    ash2017
    Sorry, still not getting required result you want.....As per your sample workbooks.
    Test 1: You fill in the boxes Then you press a button and Test2 gets filled.
    Then you type in new info in blocks and Test2 gets filled from nextrow.
    So when you need to edit and update, you then go to Test2 and make changes?

  11. #11
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    Hi Sintek,
    My apology.
    TEST1 workbook is a client query log list and will be updated everyday. This is a simple excel sheet.

    TEST 2 workbook,
    When information (filter criteria) included in the blocks (Client ref no.,Issue type,Initial/Follow-up,Date,Resolved (Y/N),Date of resolution,On time (Y/N)) and button pressed, the data will be populated below row 16. The data will be populated from TEST 1.

  12. #12
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Transfer data from one worksheet to another based on criteria

    Perhaps you should upload another sample....Use only one workbook with two sheets named Test1 & Test 2
    Then you manually enter information and highlight the result you want in Test2. Give a few examples.

  13. #13
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    now I have included in two worksheets. In report tab I want the information to be generated. I also limited the criteria (only date range).
    Attached Files Attached Files

  14. #14
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Transfer data from one worksheet to another based on criteria

    @ash2017
    One major issue. Non of your data match your criteria.

    Edit: This is referring to your original 2 workbooks.

  15. #15
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    Quote Originally Posted by CK76 View Post
    @ash2017
    One major issue. Non of your data match your criteria.

    Edit: This is referring to your original 2 workbooks.
    Hi CK76,
    Please Check the second upload. In that filter criteria is date. Column G

  16. #16
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Transfer data from one worksheet to another based on criteria

    This should do the trick
    Please Login or Register  to view this content.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    Quote Originally Posted by CK76 View Post
    @ash2017
    One major issue. Non of your data match your criteria.

    Edit: This is referring to your original 2 workbooks.
    Actually in that I was thinking if some filter criteria are blank, the data will be generated based on the criteria mentioned.

  18. #18
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Transfer data from one worksheet to another based on criteria

    One then has to put a search parameter in for each criteria and not just date.

  19. #19
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    Quote Originally Posted by sintek View Post
    One then has to put a search parameter in for each criteria and not just date.
    Your are Genius!
    Can we populate data only between two date range. Something like Criteria1:=">=” & Range("B2"), Criteria2:="<=” & Range("D2"). Also what if two different workbook. This is because 1 sheet will be used by employees. the other sheet will be kept separately.

  20. #20
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Transfer data from one worksheet to another based on criteria

    so in other words if B2 = 01/04/2017 and D2 = 02/04/2017 Then info for both dates must be populated.

  21. #21
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    yes if we include more dates, then only the data between two date range will be populated.
    Also Can we overwrite the previous data. Currently every time I press the button the same data populate in next rows.

  22. #22
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Transfer data from one worksheet to another based on criteria

    yes if we include more dates, then only the data between two date range will be populated.
    Also Can we overwrite the previous data. Currently every time I press the button the same data populate in next rows.
    Edited and amended

    Please Login or Register  to view this content.
    b
    Last edited by Sintek; 04-13-2017 at 03:34 PM.

  23. #23
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    Quote Originally Posted by sintek View Post
    Try this for current sample workbook.
    Please Login or Register  to view this content.
    Perfect! Can we avoid the duplication. Now every time we press the same data populate in rows

  24. #24
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Transfer data from one worksheet to another based on criteria

    Here's another method. Just using Date column as condition. Put both workbooks in same folder.

    Click on "Get Data" button in Report sheet of Test 2.xlsm
    Please Login or Register  to view this content.
    EDIT: Forgot to add rst.Close & cn.Close in the sample workbook. Add those lines at the end of code.
    Attached Files Attached Files
    Last edited by CK76; 04-13-2017 at 03:34 PM. Reason: See Edit:

  25. #25
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Transfer data from one worksheet to another based on criteria

    Perfect! Can we avoid the duplication. Now every time we press the same data populate in rows
    See Post #22

  26. #26
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    Thanks CK76

  27. #27
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: Transfer data from one worksheet to another based on criteria

    Thank You Sintek

+ 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. Replies: 1
    Last Post: 03-15-2017, 09:44 AM
  2. Transfer Data into another worksheet, multiple criteria
    By ExcelAnswersSearcher in forum Excel General
    Replies: 1
    Last Post: 01-02-2017, 11:28 PM
  3. [SOLVED] Transfer Cell Data From 1 Sheet To Another Based on Criteria
    By thecircularwriter in forum Excel General
    Replies: 10
    Last Post: 01-24-2016, 04:46 PM
  4. Replies: 2
    Last Post: 02-20-2013, 12:40 PM
  5. Macro to transfer row of data between sheets based on certain criteria.
    By kmc86 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-26-2012, 10:40 AM
  6. Transfer data from 1 file to another (Criteria Based)
    By amitkumarsony2412 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-05-2011, 05:43 AM
  7. Transfer data from multiple cells to new worksheet based on cell value
    By Lostinxcel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2010, 05:57 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