+ Reply to Thread
Results 1 to 15 of 15

how to copy workbook (book1) to workbook (boook2) with the help of command button

  1. #1
    Registered User
    Join Date
    03-04-2014
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    6

    how to copy workbook (book1) to workbook (boook2) with the help of command button

    how to copy workbook (book1) to workbook (boook2) with the help of command button ,BOTH THE FILE ARE LOCATED ON DIFFERENT LOCATION attached a file ie book1 there is one more book2 which is on different location once u hit the command button in book1 the data get automatically copied to book2 , please help new to macro
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,908

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    Look at this link

    http://stackoverflow.com/questions/6...book-using-vba
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    Please Login or Register  to view this content.
    Add this to your Sheets Command Button

    Hope this helps

    Excel Noub
    Last edited by Excelnoub; 03-04-2014 at 10:34 AM.

  4. #4
    Registered User
    Join Date
    03-04-2014
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    i have already tried that , didn't work for me i am using excel 2007, please help other wise my manager gonna kill me..please please

  5. #5
    Registered User
    Join Date
    03-04-2014
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    its giving me an error, on 8th line from starting runtime error-9 subscript out of range, please help

  6. #6
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    Works perfect with my Excel 2007 I am currently using this code myself.

    Could you please provide the location of your book2 and also the sheets tab name?

    You also need to change this Set rngSrc = wsSrc.Range("A2:AC" & lastrow) to your needs.

    Your workbook (Book1) sais that it should be Set rngSrc = wsSrc.Range("A2:D" & lastrow)

    I would need more information.

  7. #7
    Registered User
    Join Date
    03-04-2014
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    now it works i dont know how..but it works..u rock buddy..u r genius..if u dont mind can u please tell me like i want to design it in such a way whenever anyone opens it it will give a welcome screen with the user name thanks in advance

  8. #8
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    Do you need this in a UserForm?

  9. #9
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    Just add this to your "ThisWorkbook"

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    If you need it in a UserForm then do the following:

    Create a new Userform: Rename it to frmsplash (or whatever)

    Create within this userform: Label1, and 1 command button

    Here is the code to insert:

    Please Login or Register  to view this content.
    Have fun,

    Excel Noub

  11. #11
    Registered User
    Join Date
    03-04-2014
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    can i directly chat with u like on gmail or some any other messenger, i have lots of other problem too, and onemore thing , i dont want the book to get open once user hits command button book 1 is for user and book 2 is for admin thank u so much u r code guru man
    Last edited by shivam432; 03-04-2014 at 12:22 PM.

  12. #12
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    shivam just look at your messages in your inbox...

  13. #13
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,908

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button


  14. #14
    Registered User
    Join Date
    03-04-2014
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    hello , i added one 2 more column one is project type and other is time stamp i need some thing like whenever user enter data in project type automatically time get capture in new cell which is time stamp, thanks in advance

  15. #15
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: how to copy workbook (book1) to workbook (boook2) with the help of command button

    What is your new titles:
    A1=
    B1=
    ........F1=

    Because of this your transfer code will also need to change from A2:D to A2:F.

    If you want to add a Time/Date stamp set the following code in your sheet1:

    Please Login or Register  to view this content.
    Everytime you will add information to Column E...Column F (Activecell) will add the date stamp or change Date to Now and you will have the time stamp.

    Excelnoub

+ 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: 0
    Last Post: 07-24-2013, 01:09 PM
  2. [SOLVED] command button: specified sheet copy and save as new workbook to specified location
    By Zlatko.Pan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2013, 12:28 PM
  3. Copy sheet and command button along with code to new workbook
    By sglavan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-30-2012, 10:18 AM
  4. Copy Sheet with Command Button to new Worbook and assign macro in new workbook
    By grey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2010, 05:33 AM
  5. Copy from one workbook to another-command button
    By theSizz in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 11-28-2008, 01:24 PM

Tags for this Thread

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