+ Reply to Thread
Results 1 to 17 of 17

Saving Invoice for each items separately

  1. #1
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Saving Invoice for each items separately

    Hello

    In the attached workbook in sheet("Invoice") I would like
    1)the whole invoice to be saved
    on the sheet("InvoiceDatabase").in a way that headings (Invoice date,Invoice#,Customer,
    Customer ID,should be repeated for as many times as the number of items
    in the invoice similarly the headings bellow the invoice
    (Total,Tax Rate,Net,Disc.,Payable,Received,Balance should be repeated for as many times as
    the number of items in invoice)
    2) I want to insert more rows if items are more than 5
    The problem is if I insert rows then formulas will elap the ranges used therein.
    3) Serial numbers would be generated as the rownumber minus the number of rows
    used in the above headings.
    4)The inserted rows should adopt the formating of the current rows.
    Since this is a sample the abobe headings would be more than present.

    If you have question.Please do ask.

    Best Regards
    Imran Bhatti
    Attached Files Attached Files
    Teach me Excel VBA

  2. #2
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: Saving Invoice for each items separately

    Hi,
    Not sure I understand what result do you expect? Could you make some example: filled some values in "InvoiceDatabase" and "Invoice" sheets?

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Saving Invoice for each items separately

    This code will insert a row the way you want it to work I think:

    Please Login or Register  to view this content.
    Last edited by Arkadi; 02-14-2017 at 11:05 AM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Saving Invoice for each items separately

    It seems to me all the items in the invoicedatabase are items that reflect totals, there is nothing specific to the individual items... so why do you need to enter the invoice in the database as many times as there are items? It can be done of course, just trying to understand.

  5. #5
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Saving Invoice for each items separately

    Thanks kasan for your reply.First of all I beg pardon for not putting all the fileds headers in the InvoiceDatabase sheet. I have attached the sample with correction and put the current invoice in the database.I would like the next invoices to be saved there in the similar fashion. Hope now the need is clear.still if my poor English becomes hurdle, I will further explain.

    Best regards
    Imran Bhatti
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Saving Invoice for each items separately

    Quote Originally Posted by Arkadi View Post
    It seems to me all the items in the invoicedatabase are items that reflect totals, there is nothing specific to the individual items... so why do you need to enter the invoice in the database as many times as there are items? It can be done of course, just trying to understand.
    Because I would like to generate report(s) for each item .for example an item was sold for how in what quantity.which customer purchased it. on what date etc.

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Saving Invoice for each items separately

    Yes, with the new attachment with extra columns it makes more sense.
    In Database sheet you have "Total" column with formula sum(D2:H2) D is cust. ID... the formula makes no sense that way?

  8. #8
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Saving Invoice for each items separately

    Ooops! That was due to copy/paste just to quickly create a sample workbook. All the columns of Database sheet should be filled with a macro.If there were just items,rate qty and amount I would have better copy and paste to the next available row.but I want to other info like Date and cust ID etc.should be repeating themselves against each item.

  9. #9
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Saving Invoice for each items separately

    So Tax Amt, Net, etc should also be from Invoice and not calculated just for that item?

  10. #10
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Saving Invoice for each items separately

    Quote Originally Posted by Arkadi View Post
    So Tax Amt, Net, etc should also be from Invoice and not calculated just for that item?
    Yes.This data will represent the whole invoice .It is just like copying first of all B4:E8 to database then see how many items are there row wise the copy date of invoice and paste against each row in database.then copying cust ID ,total ,disc,etc and paste in the relevent column in database agains each item.

  11. #11
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Saving Invoice for each items separately

    Try this:

    Please Login or Register  to view this content.

  12. #12
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Saving Invoice for each items separately

    Quote Originally Posted by Arkadi View Post
    Try this:

    Please Login or Register  to view this content.
    It overwrites the headers in Database while saving the first invoice then overwrites the last record of the first invoice if we save the next invoice and so on.not offsetting one row.

  13. #13
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Saving Invoice for each items separately

    Oops! My bad...
    Replace
    Please Login or Register  to view this content.
    With
    Please Login or Register  to view this content.
    Last edited by Arkadi; 02-14-2017 at 12:48 PM.

  14. #14
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Saving Invoice for each items separately

    Quote Originally Posted by Arkadi View Post
    Oops! My bad...
    Replace
    Please Login or Register  to view this content.
    With
    Please Login or Register  to view this content.
    Nice .Working now.

    I noticed you have put some checks for blanks invoice in the bellow line of code
    Please Login or Register  to view this content.
    BUT it is saving a blank invoice as well
    and For Total the word total is a fixed string why are we refferring to Total in this line
    Please Login or Register  to view this content.

  15. #15
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Saving Invoice for each items separately

    For the first question, if there are no item numbers in column A, then it should not save anything, if the invoice is blank but Item 1 has a 1 in Column A, then it will still save. If you want to check other areas for blanks too then give me details and we can upgrade the code.

    For the second question, because we don't know how many rows there will be, we need to find the word TOTAL to know where total (and the other details below) will be. Then we check to make sure the word TOTAL was found, because if it isn't then the program won't work. The message just explains why the code is stopping ("TOTAL" was not found).

  16. #16
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Saving Invoice for each items separately

    Quote Originally Posted by Arkadi View Post
    For the first question, if there are no item numbers in column A, then it should not save anything, if the invoice is blank but Item 1 has a 1 in Column A, then it will still save. If you want to check other areas for blanks too then give me details and we can upgrade the code.

    For the second question, because we don't know how many rows there will be, we need to find the word TOTAL to know where total (and the other details below) will be. Then we check to make sure the word TOTAL was found, because if it isn't then the program won't work. The message just explains why the code is stopping ("TOTAL" was not found).

    Let me start new thread for that.I have marked this thread solved.Don't want to mark it unsolved again.
    Thanks for the offer.

    Best Regards
    Imran Bhatti

  17. #17
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Saving Invoice for each items separately

    Ok, I will keep my eyes open for a new thread if you start one.
    Thanks for marking the thread as solved, and I appreciate the rep

+ 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. Invoice Sales Tracker is messing up the invoice items
    By Kristina86 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2015, 06:47 AM
  2. Replies: 5
    Last Post: 08-08-2014, 03:50 PM
  3. Saving Invoice where next time I open file the Invoice Number increases by 1
    By domgee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2013, 03:03 PM
  4. Invoice and Its Saving File - Invoice draft
    By kuzna26 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2013, 12:13 AM
  5. Saving each sheet separately!
    By kart1224 in forum Excel General
    Replies: 1
    Last Post: 04-28-2007, 04:15 PM
  6. Invoice Number and Saving with Invoice Number (auto)
    By Markville in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-03-2007, 06:28 AM
  7. Saving a workbook separately to its macros
    By PipTT in forum Excel General
    Replies: 0
    Last Post: 02-01-2006, 06:44 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