+ Reply to Thread
Results 1 to 9 of 9

Problem writing a loop

  1. #1
    Registered User
    Join Date
    06-10-2014
    Posts
    5

    Problem writing a loop

    Good afternoon,

    Given these populated columns: Invoice Number, Invoice Item $ amount, Invoice item counter (increments the number of items on an invoice until the invoice number changes; at which point it resets to 1), I need to populate the columns titled Invoice Total $ Amount and Invoice Total # of items, I can't have these as a subtotal I need to have these values next to each individual record. In other words, both the Invoice Total $ Amount and Invoice Total # of Items will have the same values until the data in the Invoice Number column changes.
    I am fairly certain that I cannot use a formula for this as there is no stable pattern associated with the change in Invoice Number so I must write a loop. Please help me write a loop for this.

    Thanks for reading and for your assistance, have a wonderful day!

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Problem writing a loop

    Please submit an example workbook with a worksheet showing your data and a worksheet showing how you would like to appear.

  3. #3
    Registered User
    Join Date
    06-03-2014
    MS-Off Ver
    2007
    Posts
    87

    Re: Problem writing a loop

    Message edited - wrong subject - mistake.
    Last edited by SIMBAtheCAT; 06-10-2014 at 07:13 PM.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Problem writing a loop

    Hello themindseye,

    Welcome to the Forum!

    Excel has templates available for Invoicing. I would take a look and see what might fit your needs. It could save you a lot of time.

    Here is how to upload your workbook...

    How To Post Your Workbook
    1. At the bottom right of the Reply window, Click the button Go Advanced
    2. At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    3. Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    4. Click the Select Files button at the bottom middle of the dialog.
    5. In the new window Find the file you want to upload, select it, and Click Open.
    6. You will now be back in the File Manager dialog. Click the bottom Middle button Upload File.
    7. Wait until the file has completely uploaded before you exit the File Manager dialog.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Registered User
    Join Date
    06-10-2014
    Posts
    5

    Re: Problem writing a loop

    Quote Originally Posted by stnkynts View Post
    Please submit an example workbook with a worksheet showing your data and a worksheet showing how you would like to appear.
    Hi, sorry for the delay in uploading this, and thanks for your help! Please look at the center worksheet, partial title is Refund Ins Detail, as an example, column F contains the total amount for that invoice number in each row populated by said invoice number and column E contains the total invoice amount in the same format. The source for column E is Column S.

    I had to delete the other worksheets before upload because the file was too large.

    Thanks again for your help!!

  6. #6
    Registered User
    Join Date
    06-10-2014
    Posts
    5

    Re: Problem writing a loop

    Please someone help me with this topic.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Problem writing a loop

    Hello themindseye,

    After looking at the sample workbook, it appears the columns Invoice Total $ Amount and Invoice Total # of items need to be added to the worksheet.

    You mention...
    In other words, both the Invoice Total $ Amount and Invoice Total # of Items will have the same values until the data in the Invoice Number column changes.
    However, there is no data currently in the Invoice Number column. The only sequential numbers appear in NUMBER and VOUCHER NUMBER(15) columns. Did you mean Vouchers and not Invoices?

    As I understand the post, the totals will be repeated for each item listed in the invoice. Is that correct?

  8. #8
    Registered User
    Join Date
    06-10-2014
    Posts
    5

    Re: Problem writing a loop

    Yes I did mean the voucher numbers, sorry for the confusion. And Yes to your second question as well. Thanks.

  9. #9
    Registered User
    Join Date
    06-10-2014
    Posts
    5

    Re: Problem writing a loop

    If anyone can, please help with this thread. Thanks!!!

+ 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. Help with writing VBA code to loop Solver
    By yegor2000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2012, 06:11 PM
  2. Need help writing Loop syntax
    By sslack88 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-26-2012, 11:02 PM
  3. Issue writing a loop
    By bg18461 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-30-2008, 08:27 AM
  4. writing a loop to parse multiple sheets.
    By ynnod in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-25-2007, 04:19 PM
  5. help writing loop
    By robhargreaves in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2005, 06:05 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