+ Reply to Thread
Results 1 to 8 of 8

Copy invoice data to another workbook

  1. #1
    Registered User
    Join Date
    10-26-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Exclamation Copy invoice data to another workbook

    Hi all!

    I'm very new to using macro's and i don't really know what I'm doing.
    I've got myself a bit confused with this one. I am trying to write a macro(or a couple?) which when used, opens another workbook then copy the invoice details to the second workbook, save the invoice as a seperate file, then clear the invoice and increment the invoice number, and closes the second workbook.
    I think I have macros to open the second workbook, increment the invoice number and save each invoice as seperate file, however I can't seem to get it to copy data to second workbook and move down a line. in preparation for next invoice.

    The first file is "Invoice template" and the details are on the sheet called "Invoice" in cells F4,F5,F6,G18,G41
    The second file is called "Bookkeeping" and the sheet the need to go to is "Invoice List" starting in cells A3,B3,C3,D3,E3 respectively for the first invoice then moving down a row.

    For some reason I just can't get this to work at all! I have tried recording a macro but had no joy. I must admit that the macro's I used for the other actions were not written by myself, but shamelessly google'd on the internet.
    Ideally I would like to make it so that it all happens in one big macro but I don't know if this is possible?

    Thank you all in advance
    Last edited by Gstacey; 06-28-2013 at 09:46 AM.

  2. #2
    Registered User
    Join Date
    10-26-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Copy invoice data to another workbook

    Bump - No response

  3. #3
    Registered User
    Join Date
    10-26-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Copy invoice data to another workbook

    Bump - No response still!

    Please can anyone help with this one??

  4. #4
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Copy invoice data to another workbook

    Hi..

    Upload your Workbook(s).. you will get way more help if people don't have to recreate your scenario...

  5. #5
    Registered User
    Join Date
    10-26-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Copy invoice data to another workbook

    Ok Thanks!

    I've attached the workbook in progress. The code i have so far is

    Please Login or Register  to view this content.
    It keeps coming up with Runtime error 1004
    Thanks in advance
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Copy invoice data to another workbook

    Hi..

    You got me confused as to what exactly you want..

    Anyway.. here's code that will copy the data to the next row after the Last Used row..


    Please Login or Register  to view this content.
    Note: I wasn't sure which Workbook you want the data to go to.. so for example.. if the sheet "Invoice List" is in the "Bookkeeping" Workbook.. then add the Workbook name in the code (at each required place):

    Example:

    Please Login or Register  to view this content.

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Copy invoice data to another workbook

    Hi, Gstacey,

    you could use just one macro instead of 3 and combine all the functions you want in there:
    Please Login or Register  to view this content.
    In ThisWorkbook I added a procedure to make sure that sheet Invoice shows up on opening:
    Please Login or Register  to view this content.
    And I slightly worked on your Formulas as well.

    BTW: you would have needed to adjust the range you wanted to clear the contents. in

    Ciao,
    Holger
    Attached Files Attached Files
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  8. #8
    Registered User
    Join Date
    10-26-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Copy invoice data to another workbook

    Thank you for the replies! I'm not able to try them yet as am work but will give it a go tonight


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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