+ Reply to Thread
Results 1 to 20 of 20

Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

  1. #1
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    I would like to copy data from "Source" sheet to "Target" sheet. Source sheet has some extra 2 columns info than Target sheet.
    I want to remove the extra 2 columns info before copy to Target sheet.
    My problem now is the back to back column, after deleting the first column, the counter still +1, the back to back column will be miss.

    Target Sheet
    1.jpg

    Source Sheet
    2.jpg




    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mankit87; 07-16-2019 at 08:49 PM.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

  3. #3
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Thanks amended.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,521

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Is this how you want?
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Quote Originally Posted by jindon View Post
    Is this how you want?
    Please Login or Register  to view this content.
    This can merge but my case is that the header always different. Need the code to find then merge at same header.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,521

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Quote Originally Posted by jindon View Post
    Please Login or Register  to view this content.
    Hi, just tried. but it didn't copy to same header.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,521

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    1) Don't quote whole post unless you really need to do it, the forum doesn't like it.

    2) I did other way around...
    try change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Quote Originally Posted by jindon View Post
    1) Don't quote whole post unless you really need to do it, the forum doesn't like it.

    2) I did other way around...
    try change
    Hi, it works now! Thanks.

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,521

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    You are welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  11. #11
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Quote Originally Posted by jindon View Post
    You are welcome.
    Hi if i want to check form a1 till the end, seem like this code till k1 only.

    Please Login or Register  to view this content.

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,521

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    You can change it to
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Quote Originally Posted by jindon View Post
    You can change it to
    Thank you, wish you have a good day!

  14. #14
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Quote Originally Posted by jindon View Post
    You can change it to
    Hi i found a problem during executing the code.
    I found that the Source column do not paste to the respective column at Target. I attached a picture to illustrate.

    1.jpg
    Last edited by mankit87; 07-17-2019 at 05:47 AM.

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,521

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Try change to
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Quote Originally Posted by jindon View Post
    Try change to
    Thank you!!

  17. #17
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Quote Originally Posted by jindon View Post
    Try change to
    Just now using code for one of my excel, i encounter this error. Not sure how to fix this.
    1.jpg

  18. #18
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,521

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    No idea.
    Upload your workbook.

  19. #19
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    Quote Originally Posted by jindon View Post
    Upload your workbook.
    workbook is attached. Thanks
    Attachment 632873

  20. #20
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Copy Data from "Source" Sheet to "Target" Sheet (Code need help thanks)

    I think i found the problem, if i uncheck the R1C1 reference style, the code works fine



    1.jpg

+ 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. Looping thru rows and copy cell values from "Inputs" sheet to "Output" sheet
    By hariexcel1987 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2015, 11:32 PM
  2. "Worksheet change" not changing cell on other sheet to match target cell "fill".
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-02-2015, 12:02 PM
  3. Script not copying data from "Emails" sheet to "New Sheet" - Run time error: Object
    By methuselah90 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-08-2014, 03:22 PM
  4. [SOLVED] Code that copies row of data to another sheet based on text "Complete"/"Delete"
    By Dremzy in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-20-2014, 05:51 PM
  5. Replies: 2
    Last Post: 04-20-2014, 11:18 AM
  6. Replies: 3
    Last Post: 05-31-2013, 05:16 AM
  7. Enter Data on "Main" or "Input" Sheet and Copy to One of Many Other Sheets
    By timothy_no7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2012, 07:29 PM

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