+ Reply to Thread
Results 1 to 11 of 11

Transfer Cell Data From 1 Sheet To Another Based on Criteria

  1. #1
    Registered User
    Join Date
    02-18-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    49

    Transfer Cell Data From 1 Sheet To Another Based on Criteria

    I am not sure whether to use a table or formula to do this. The attached has 4 sheets. The 1st one has the the final data I want to get from the 3rd and 4th sheets and the 2nd sheet is where I want to pull the information to. I am looking for DCT MISS, LON & KIT in column E and when it finds one of them, it should transfer data from the same row in columns A, D & F to the manifest in the appropriate location.

    It would be easier if sheets 3 and 4 were consolidated on 1 sheet but the powers that be want to retain the same layout although I could do a macro for that. Any and all help appreciated.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Transfer Cell Data From 1 Sheet To Another Based on Criteria

    Hi thecircularwriter

    If you're open to Code (Macros)...
    1. Do we have ONLY 3 Destinations (DC, MISS, LON & KIT)
    2. Do we IGNORE all others (OTHER 1, OTHER 2, etc.)
    3. In Manifest you have 10 Slots for Data in each Destination...will there EVER be MORE than 10.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    02-18-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Transfer Cell Data From 1 Sheet To Another Based on Criteria

    Yes, it is only the 3 starting with DCT that are relevant. I understand your concern about the 10 spaces and while it is unlikely that they will be exceeded, I hope when I see and understand how you have done it, I will be able to make any future adjustments myself. Looking forward to your response. Thanks

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Transfer Cell Data From 1 Sheet To Another Based on Criteria

    Hi thecircularwriter


    Regarding this...
    I understand your concern about the 10 spaces and while it is unlikely that they will be exceeded, I hope when I see and understand how you have done it
    There could be some fancy/dancy Code that could sort that out, HOWEVER, what's your MAX...much simpler.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Transfer Cell Data From 1 Sheet To Another Based on Criteria

    Se3e if this ARRAY formula will help you. It is designed for just 1 sheets, and is coded for just the LONDON table. All you need to do is change that for the other tables...
    =IFERROR(IFERROR(INDEX(Pickups!A:A,SMALL(IF(Pickups!$E$5:$E$23="DCT LON",ROW(Pickups!$A$5:$A$23)),ROWS($A$1:A1))),INDEX(Other!A:A,SMALL(IF(Other!$E$5:$E$23="DCT LON",ROW(Other!$A$5:$A$23)),ROWS($A$1:A1)-COUNTIF(Pickups!$E$5:$E$23,"*Lon*")))),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,837

    Re: Transfer Cell Data From 1 Sheet To Another Based on Criteria

    In the attached file I've set this up for you using a few formulae, as follows:

    I've used column H as a helper column in both the Pickups and Other sheet, with this formula in H5 of both sheets, copied down beyond your data (as can be seen by the hyphens):

    =IF(E5="DCT KIT","Kit_"&COUNTIF(H$4:H4,"Kit_*")+1+H$1,IF(E5="DCT LON","Lon_"&COUNTIF(H$4:H4,"Lon_*")+1+H$2,IF(E5="DCT MISS","Mis_"&COUNTIF(H$4:H4,"Mis_*")+1+H$3,"-")))

    In addition, I've used cells H1 to H3 to pick up the count of the KIT, LON, and MIS entries from the previous sheet - in the Pickups sheet these are all set to zero, but H1 in the Other sheet uses this formula:

    =COUNTIF(Pickups!E:E,"DCT KIT")

    with similar formulae in H2 and H3 for the other types. The formula maintains 3 unique record codes, by adding a sequential number onto each of Kit_, Lon_ or Mis_ as appropriate. These numbers continue onto the Other sheet.

    On the Manifest sheet I've used this formula in A5:

    =IFERROR(INDEX(Pickups!A:A,MATCH("LON_"&ROWS($1:1),Pickups!$H:$H,0)),IFERROR(INDEX(Other!A:A,MATCH("LON_"&ROWS($1:1),Other!$H:$H,0)),""))

    This tries to find a match in the Pickups sheet for the LON_nnn code (and if not present it looks in the Other sheet), where nnn is generated by the ROWS($1:1) term which increases as the formula is copied down. If a match is found then it returns the value from column A on that row. A similar formula can be put in column C, although you will want to get data from column D of the Pickups or Other sheets, and another similar formula in column G (returning data from column F). I've amended your formula in B5 to this:

    =IF(A5<>"",$A$3,"")

    This row of formulae can be copied down to row 14. Similar formulae can be used for rows 17 and 29 and then copied down, although the reference to LON_ (shown in red above) will need to be changed as appropriate.

    If you need more than 10 records, then just insert a few rows and copy the formulae down as required.

    Hope this helps.

    Pete
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-18-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Transfer Cell Data From 1 Sheet To Another Based on Criteria

    Thanks Ford. It works when I copy your formula and paste but what I select the cell with the formula in it and press CTRL+SHIFT+ENTER, the brackets don't change and it returns the first entry from row A5 on picksup not the row corresponding to the first DCT LON which is on row 8 on pickups. I am going to study how arrays work more thoroughly but in the meantime if you could tell me what I'm doing wrong, I would appreciate it.

    Thanks again for your time.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,837

    Re: Transfer Cell Data From 1 Sheet To Another Based on Criteria

    Did you look at my solution?

    Pete

  9. #9
    Registered User
    Join Date
    02-18-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Transfer Cell Data From 1 Sheet To Another Based on Criteria

    Yes Pete. This absolutely works and thanks so much for all information on what the formulas are doing. This is of enormous help for I do want to understand it as well as just getting done so I can utilize the knowledge in future as opposed to coming on this forum and having some one do it for me. I may have a few additional questions for you to ensure I understand it properly.

    Thanks so much.

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,837

    Re: Transfer Cell Data From 1 Sheet To Another Based on Criteria

    Well, glad to be able to help - ask away when you are ready.

    Also when you are ready, you might like to select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    And, you can also directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

    EDIT: Ah, I see you have done that - thanks for the rep.

    Pete

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Transfer Cell Data From 1 Sheet To Another Based on Criteria

    You need to do more than just select the cell and press CSE, you need to EDIT the cell, then press CSE

+ 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 and append dynamic data from one sheet to another
    By fiasco in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-31-2014, 01:41 AM
  2. Replies: 2
    Last Post: 02-20-2013, 12:40 PM
  3. Transfer cell value from sheet to sheet based on user input (SOLVED)
    By Terrydorset in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-18-2013, 01:28 PM
  4. 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
  5. [SOLVED] PLEASE HELP - Macro needed to transfer data to another sheet if it meets a one criteria
    By Geller in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-10-2012, 12:22 PM
  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. [SOLVED] Transfer single cell information to specific cell based on user criteria
    By RoVo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-31-2006, 11:30 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