+ Reply to Thread
Results 1 to 12 of 12

code for calling invoices

  1. #1
    Forum Contributor
    Join Date
    06-06-2007
    Posts
    248

    code for calling invoices

    Dear sir,with best regards,enclosing herewith a sample of an invoice asking you kindly the possibility to :
    - creating a code for calling any invoice mentioned in ( invoices ) worksheet.
    - creating a code for printing the calling invoice.
    - change the way of saving from (horizontal) to (vertical).
    Many thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    06-06-2007
    Posts
    248

    Re: code for calling invoices

    Dear sirs,with regards,any hope to get any reply.
    Accept my apology.

  3. #3
    Forum Contributor ebin charles's Avatar
    Join Date
    03-31-2010
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    255

    Re: code for calling invoices

    Quote Originally Posted by tofimoon4 View Post
    Dear sirs,with regards,any hope to get any reply.
    Accept my apology.
    You can a have invoice in sheet1 and store only data in next sheet2 horizontally.
    If you want to edit and save or print you can retrieve from sheet2 to invoice(sheet1).

    That will be better way.

    Charles

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: code for calling invoices

    You need to save relevant data such as Date, Invoice Number, Total to a table in a sheet. For code see the Contact Form example

    Save the Invoice number in Column A of the table the use VLOOKUP to populate the data back to the form when required
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Contributor
    Join Date
    06-06-2007
    Posts
    248

    Re: code for calling invoices

    Many thanks my dears for advices,i want to ask if is it possible to create a macro for printing any invoice (with its range) mentioned in ( invoices ) sheet .
    My regards.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: code for calling invoices

    You've already been told the best way to do this

  7. #7
    Forum Contributor ebin charles's Avatar
    Join Date
    03-31-2010
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    255

    Re: code for calling invoices

    Quote Originally Posted by tofimoon4 View Post
    Many thanks my dears for advices,i want to ask if is it possible to create a macro for printing any invoice (with its range) mentioned in ( invoices ) sheet .
    My regards.
    You can use this code for printing selected area as you say invoice
    in a sheet20

    Please Login or Register  to view this content.
    If you are ok in preview then go for printing.

    charles

  8. #8
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: code for calling invoices

    Quote Originally Posted by tofimoon4 View Post
    Many thanks my dears for advices,i want to ask if is it possible to create a macro for printing any invoice (with its range) mentioned in ( invoices ) sheet .
    My regards.
    Hi

    Whilst the way in which you are storing your invoices is not the preferred method, you can select and printout any invoice from your sheet with the following code, provided you make one alteration to your invoice.

    I added a formula in cell I2 or your Invoice which is
    =I6
    I formatted the cell with a Custom format of ;;; which prevents the value from being visible.

    I did the same for each of the invoices already stored.

    Note, that you need to put in some error checking to ensure that you don't have too many invoices stored, to exceed the maximum number of columns in XL2003 which is 256 columns or that when you get up to that number you give a row offset to move the next invoices down the page starting again at the left of the page.

    If you do this you will need to amend the Print routine accordingly.


    Please Login or Register  to view this content.
    Attached Files Attached Files
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  9. #9
    Forum Contributor
    Join Date
    06-06-2007
    Posts
    248

    Re: code for calling invoices

    Many thanks my dear for help

  10. #10
    Forum Contributor ebin charles's Avatar
    Join Date
    03-31-2010
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    255

    Re: code for calling invoices

    Quote Originally Posted by tofimoon4 View Post
    Many thanks my dear for help
    It looks quite pretty now,
    But when you try to save nearly more than 50 invoices, your file size will be
    25 to 30MB. Because your every invoice have Wordart box.

    So if you save your data in next sheet in row by row (horizontal).
    You can save more than 5 thousand invoice.
    How you do If you need to edit back one invoice?

    Charles

  11. #11
    Forum Contributor
    Join Date
    06-06-2007
    Posts
    248

    Re: code for calling invoices

    Dear Mr.Roger Govier,many thanks for your excellent solution which will save me from big problem , as you have mentioned in your message about the limited columns in excel 2003 ,is it possible to :
    - complete the saving from the row (47) and rows below .( by modify the code )
    - or save the invoices vertically.
    I think your genius will solve the problem.
    My appreciation.

  12. #12
    Forum Contributor
    Join Date
    06-06-2007
    Posts
    248

    Re: code for calling invoices

    Dear sirs,with my regards,can i wait for any arrangements or consider the request as solved.
    Many thanks in advance.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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