+ Reply to Thread
Results 1 to 5 of 5

Code to find and copy specific data

  1. #1
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Question Code to find and copy specific data

    Good afternoon Excel Forum!!!

    Everyone has been extremely helpful so far and I hope they can help with this also!

    I would love to find some code that will take the data from C2, and paste to a different workbook based on the information in A2 and B2. I have attached samples of the workbooks I am trying to work with("In" & "Out"). I want to copy the serial number in column C(serial Number) from the "Out" workbook and paste into the "Serial Shipped Column in the "In" workbook, based on the corresponding data in Columns A & B. Workbook "Out" has the sheet name as "Today's Date" and is what we use as a packing list for the devices being shipped back to the customer and is used to validate the box labels on the devices being shipped. The workbook labeled "In" has worksheets that are labeled based on the RSA numbers of the shipment received from the customers. It is also formatted for duplicates based on the range of the item numbers on each sheet. So if the label scanned was correct, then when you paste the serial number from the "Out" workbook to the corresponding first blank cell in the correct RSA worksheet for that item number, then it will highlight red.

    I would like to be able to highlight the serial number on the "Out" workbook if the following occurs...
    1) The serial number does not hightlight red or if it highlights green
    2) The RSA does not exist on the "In" workbook
    3) The Item number does not exist on the RSA sheet in the "In" workbook for the serial trying to be validated
    4) No Blank cell to paste the serial number on the "In" workbook

    I look forward to either your coding skills or your ability to point me to the correct resources to get this process completed.


    Thanks!!!

    Dan
    Attached Files Attached Files

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Code to find and copy specific data

    I am not sure what you are after, can you explain a little more in detail? Maybe giving a desired outcome file?
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Code to find and copy specific data

    JapanDave,

    I have attached a sample of what I would like the outcome to be.

    Now, I have 2 desired outcomes...

    1. To have the workbook titled "In", to be updated with the data from the workbook titled "Out." The "In" workbook should be updated to reflect the outgoing shipment of devices back to the customer. So the workbook may show that the customer is due back 15 total devices before the outgoing shipment, but once this validation process occurs, then maybe only 4 devices are due back to the customer relative to the "RSA" received. In simplest terms, we copy the serial number from the "Out" worksheet, find the RSA worksheet in the "In" workbook that corresponds to that serial number's RSA on the "Out" workbook, then find the right item number relative to that serial number and paste the serial number in the "In" workbook in the first blank cell in the "Serial Shipped" column on the "RSA"worksheet.

    2. Have the serial number highlighted on the "Out" workbook, if the following occurs...
    a) There are no blank cells for that part number on the RSA worksheet relative to that Serial number on the "Out" workbook
    b) The serial number gets highlighted green on the RSA worksheet, in the "In" workbook
    c) The serial number doesn't highlight red on the RSA worksheet in the "In" workbook
    d) The Item number or RSA does not exist

    I believe I have explained this as best as I can unless you were next to me and seeing it in action.

    I have attached the desired outcome workbooks and also attached a revised "Out" workbook. The original one I posted, had the wrong column headers and this sample workbook is corrected.

    Thanks!!!!!

    Dan
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Code to find and copy specific data

    Can anyone given give me some direction with the above issue? I have been thinking about this a lot and was thinking that this process would probably be similar to a VLookup function. The only difference is I would to paste the data in column C from the "Out" workbook to the appropriate "In" Worksheet based on the criteria of Item and RSA (or Column B and A respectively). I have to no problem experimenting if I can get some direction as to where to start or what the code should include...which I think is going to consist of a few If/Then statements.

    Thanks!!!!!

  5. #5
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Code to find and copy specific data

    Lets see if anyone has some ideas on this....

    Does ANYONE the best way to code this? The code would need to go row by row. Starting with row 2, find the data that is found in "A2" on the "Out" workbook and find the sheet name that matches, then find the item number listed in column "B" of the "Out" workbook and find in the sheet just found in the "In" workbook and then paste the serial number is column "C" of the "Out" workbook in the first blank cell for that item on that sheet in the "In" workbook.

    Any ideas to test or resources to figure this out would be a HUGE help!!!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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