+ Reply to Thread
Results 1 to 12 of 12

Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

    Hi.

    i try use code in:http://www.rondebruin.nl/win/s3/win024.htm

    But i need use in multiples sheets (from -> OrgFile) to multiples sheets (to -> DestFile)

    How adapt this code to copy (OrgTab1, OrgTab2, OrgTab3) from OrgFile to (DesTab1, DesTab2, DesTab3) DestFile
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Images Attached Images
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,633

    Re: Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

    Why not instead of
    Please Login or Register  to view this content.
    just a simple loop, like:
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

    Hi Kaper, tahnk you!

    But how do it based my real file?
    Tip Name
    Origin file ContrAva_ES.xlsx
    Tab Origin file Alex
    Tab Origin file Glaucia
    Tab Origin file Patricia
    Tab Origin file Escher
    Tip Name
    Destination file John_Controle de Avarias_PAN ES.xlsm
    Tab Destination file Alex
    Tab Destination file Glaucia
    Tab Destination file Patricia
    Tab Destination file Escher

  4. #4
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

    Hi any idea?

    thank you!!

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,633

    Re: Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

    for instance if names in source and destination are always the same:
    Please Login or Register  to view this content.
    or if destination names are different than origin
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

    hi.
    Display error message
    compilation error
    Incompatible type of argument ByRef
    Thank you!!

  7. #7
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,633

    Re: Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

    check again names - especially OrgFile.xlsx vs ContrAva_ES.xlsx

  8. #8
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

    I try, but still display error
    look my picture
    Attached Images Attached Images

  9. #9
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,633

    Re: Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

    Looks fine for me. but it's always better to experiment (or investigate) with a file not just a screenshot. of course not real files but smaller dummy files where problem persists.

  10. #10
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

    Look at my files, please.

    thank you!!!
    Attached Files Attached Files

  11. #11
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,633

    Re: Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

    Do explicit type conversion to string in:
    Please Login or Register  to view this content.

  12. #12
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Adapt Code to copy and paste multiple Ws to multiples Ws to another Wb

    Hi karper, nice.

    very very good!

    Thank very much!

+ 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 paste values over multiples selections
    By ammartino44 in forum Excel General
    Replies: 6
    Last Post: 05-08-2015, 01:52 AM
  2. VBA code to copy, paste and transpose every 5th row from multiple worksheets
    By cog38 in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 03-23-2015, 02:28 PM
  3. Code NOT working properly - Copy/Paste Multiple Tables
    By Blackhawks in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-14-2014, 12:18 PM
  4. How to adapt this code to copy unique values in cells
    By RayJay01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2014, 07:18 AM
  5. [SOLVED] VBA Code to copy data from one sheet and paste to multiple other sheets
    By JimmyG. in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2013, 04:25 AM
  6. Replies: 6
    Last Post: 12-15-2012, 05:08 PM
  7. [SOLVED] Adapt code to copy and paste
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-09-2012, 07:52 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