+ Reply to Thread
Results 1 to 9 of 9

Generate multiple invoices fetching data from rows of a sheet

  1. #1
    Registered User
    Join Date
    09-12-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Generate multiple invoices fetching data from rows of a sheet

    Dear Friends,

    This forum has came as a wonderful hand of help and I need solution to a problem of mine.

    I have a sheet (Annexure 13024) with multiple rows, having information of Invoice No., Invoice Date, VSAT ID, Days etc. In the adjacent sheet the invoice template is attached. The template needs to be populated fetching the data from the rows of Sheet "Annexure 13024" in a way that an invoice is generated for data of each row. I hope I have been able to convey what I exactly want to do. Both the sheets (Annexure and Invoice Template) are in the attached "Test.xlsx"

    Would be more than happy to have a solution to this.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Generate multiple invoices fetching data from rows of a sheet

    Does this help?

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-18-2013
    Location
    Prague, Czech rep.
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    138

    Re: Generate multiple invoices fetching data from rows of a sheet

    Hi both,

    as i saw some code suggest already in place i wanted to pass this thread but than run down the code in task and Ive one small&big objection regarding the error handling procedure.

    if i may suggest, never implement resume next in your code unless there is known bug in execution which prevents you from proper error handling rutine...resume next can give you quite a lot of troubles on its own and its better to see if there is some error occuring during the code execution etc. also you havent put it back to default after the code, so its still on resume next which is Id say deadly for any code modification to the future cause user wont be able to actualy tell if the new code is doing what it should or not, unless he goes through whole output.

    therefore if you wanna implement resume next even though I highly disapprove such approach use at least the second part of it, put at the end:

    Please Login or Register  to view this content.
    but still Id suggest using different method of error handling

    best regards both

    Soul

    PS -- Ill check on this later when devang responds if hes happy with the code, but apart from the error handling seems solid

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Generate multiple invoices fetching data from rows of a sheet

    Quote Originally Posted by SoulPrisoner View Post
    Hi both,

    as i saw some code suggest already in place i wanted to pass this thread but than run down the code in task and Ive one small&big objection regarding the error handling procedure.

    if i may suggest, never implement resume next in your code unless there is known bug in execution which prevents you from proper error handling rutine...resume next can give you quite a lot of troubles on its own and its better to see if there is some error occuring during the code execution etc. also you havent put it back to default after the code, so its still on resume next which is Id say deadly for any code modification to the future cause user wont be able to actualy tell if the new code is doing what it should or not, unless he goes through whole output.

    therefore if you wanna implement resume next even though I highly disapprove such approach use at least the second part of it, put at the end:

    Please Login or Register  to view this content.
    but still Id suggest using different method of error handling

    best regards both

    Soul

    PS -- Ill check on this later when devang responds if hes happy with the code, but apart from the error handling seems solid
    Thanks for the oversite on my part SoulPrisoner. I definitely should have added the second part.

    Please Login or Register  to view this content.
    The purpose of the Error handling in this case is not to catch errors but to prevent the macro from stalling if it finds an Invoice sheet with the same name has already been created. I assumed the OP would be refilling the source data sheet. I could be wrong, and the error handling may be useless, but it was added to prevent the macro from stalling.

  5. #5
    Registered User
    Join Date
    09-12-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Generate multiple invoices fetching data from rows of a sheet

    Dear John H. Davis,

    Thanks a lot. You made my day and saved so much of my time and efforts. This is working perfectly fine. Just changed it a bit to my requirement for the points that I missed to mention. I wish to learn the kind of coding you just did. Request to pass any guiding tips to start with.

    Once again...thanks a lot.

    Devang

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Generate multiple invoices fetching data from rows of a sheet

    You're welcome. Glad to help out and thanks for the feedback. Please consider the points made by SoulPrisoner as well. If there is no need for the error handling please remove it from the code. Also please comply with Forum Rule No.9.

    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

  7. #7
    Forum Contributor
    Join Date
    01-18-2013
    Location
    Prague, Czech rep.
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    138

    Re: Generate multiple invoices fetching data from rows of a sheet

    Yap I know why you put that in place there. Im used to use that one myself to just be sure it wont stuck at certain places....;-)....anyways GJ...

  8. #8
    Registered User
    Join Date
    09-12-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Generate multiple invoices fetching data from rows of a sheet

    Yes, I will do it right away.

    Quote Originally Posted by JOHN H. DAVIS View Post
    You're welcome. Glad to help out and thanks for the feedback. Please consider the points made by SoulPrisoner as well. If there is no need for the error handling please remove it from the code. Also please comply with Forum Rule No.9.

    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

  9. #9
    Registered User
    Join Date
    09-12-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Generate multiple invoices fetching data from rows of a sheet

    Thanks for the suggestions of SoulPrisoner, as well.

+ 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: 01-14-2013, 01:44 PM
  2. Generate List of Matching Rows from multiple tabs
    By xenocide8d in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-02-2010, 12:52 AM
  3. [SOLVED] Fetching rows across sheets dynamically
    By oola in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-01-2005, 08:30 PM
  4. How to batch create / generate and print invoices from Excel data?
    By helenerz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2005, 10:05 PM
  5. generate multiple rows based on cell value
    By Theresa in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-25-2005, 06:21 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