+ Reply to Thread
Results 1 to 16 of 16

copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

  1. #1
    Registered User
    Join Date
    11-07-2013
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    51

    copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    I have been searching to find out how to do this, and can't get my code to work, please help!! I have attached a sample file for reference.

    The "copy new order" and location tabs are entered daily and new information is added, we are trying to skip the step where we enter the same information into three sheets, (location tabs, copy cal, copy new order)

    The order numbers in the location tabs need to have all information filled in. the information is in two other sheets ("copy cal", "copy new order"). I need it to auto populate in the location tabs from the "copy new order" tab. I need to search PO column (C) in "copy new order" tab and fill in the data from the row for that order in the corresponding location tab. I don't want to overwrite, just need to fill the information in. I have been trying to use a combination of VLOOKUP and an IF formula, however I keep getting an error in the results. I would rather have a macro written to move the data over.

    From "copy new order" tab the cell in AN copies into H in correct sheet based on po# (col C in new order tab, col A in corresponding location tab)
    AW in "copy new order" goes to I in location tab , AT to K, AR to L, AS to M, AF to Q, E to R, and AO to S.

    the PO#s will always start with one of the following letter sequences followed by 4 number digits.
    SA=MOULTRIE
    SFC=COLLINS
    SFH=HAMMOND
    SFL=LAUREL
    SFM=MCCOMB
    SFT=BRYAN
    SFW=WACO
    SFZ=HAZELHURST
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    Hi,

    Is it only the data from those identified columns that must be transferred? So iow... its not the entire row.
    Also, how will the macro determine which records in the copy new order sheet to transfer. Is there a way to determine this, or will it just be all records that occur on the sheet?
    Last edited by RudiS; 05-08-2014 at 04:07 PM.
    Regards,
    Rudi

  3. #3
    Registered User
    Join Date
    11-07-2013
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    yes, only those listed. and they must be put in the correct column in the location tab and row based on PO #

  4. #4
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    TX.
    Please see my previous post as I added another question.

  5. #5
    Registered User
    Join Date
    11-07-2013
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    In.the location tabs (Collins, laurel,etc) the PO # will be entered by another person in my office. That should be.the determining factor as to which.row to pull information from in copy new order.

  6. #6
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    Ah, I was looking at it from the other side.
    I was thinking that data was added to the copy new order sheet and those new records had to be placed in the location tabs.

    So the macro actually has to loop through the location tabs and add in details from the copy new order sheet where the records in location tab only have the PO#
    Please confirm....

    Sorry for all the questions...I'm just trying to work out the process that the macro must follow.

  7. #7
    Registered User
    Join Date
    11-07-2013
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    Yes that's it exactly. No worries I wasn't sure how to explain it. Or if I did a good job of explaining.

  8. #8
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    Great. I have an idea of what is required.
    I'll start setting up a macro to automate this, however...I'm first off to bed now. If no-one else has replied by morning, I'll post my reply soon after.

  9. #9
    Registered User
    Join Date
    11-07-2013
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    Terrific!! Thank you.

  10. #10
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    Hi,

    Here is the workbook with macro to automate the transfer of data from source sheet to destination sheets.
    Please note the instructions in the workbook (in the cell comment).

    Let me know how it runs...
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-07-2013
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    One quick question, will this run to the empty cell in each tab, or does the PO# column need to be sorted in order? For example if I have PO# listed in the following order:
    1512, 1518, 1515, 1513,
    Will it stop after the 1512, or at the end of the 1513?

    It works exactly the way I needed it to! Thank you so much!

  12. #12
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    The sort order will not affect the macro. It will run until the last cell in the C column only processing the rows where the D columns cell is blank.

    Glad to hear that it is working.

  13. #13
    Registered User
    Join Date
    11-07-2013
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    One last thing I just realized that its overwriting data from previous updates. is there a way to specify that if the to be filled in cells are blank fill in, and if they already have data in them to not paste in them?

  14. #14
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    Hi,

    I have updated the code in the attached workbook.
    Please test and verify it is running as required.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    11-07-2013
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    PERFECT!!
    Thanks again!

  16. #16
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2

    Excellent. Glad its working well.

+ 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: 6
    Last Post: 07-25-2013, 02:58 PM
  2. [SOLVED] Copy data from column A and B Sheet1 and paste into Sheet2
    By rabra in forum Excel General
    Replies: 2
    Last Post: 02-03-2013, 11:39 AM
  3. [SOLVED] Take Data From Column on Sheet1 and Insert Into Next Blank Row on Sheet2 Then Clear Sheet1
    By abutler911 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-09-2013, 06:30 PM
  4. [SOLVED] Copy and Paste Entire Row from Sheet1->Sheet2 based on text string match in Sheet1 Row
    By dmlovic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-17-2012, 08:42 AM
  5. Excel macro to copy data from Sheet1 row into Sheet2 column
    By peleong in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-12-2011, 10:56 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