Results 1 to 14 of 14

FIFO Based Receipt Adjustment To determine date when particular invoice is finally cleared

Threaded View

spremkishan FIFO Based Receipt Adjustment... 08-12-2015, 02:24 AM
excelliot Re: FIFO Based Receipt... 08-12-2015, 02:42 AM
excelliot Re: FIFO Based Receipt... 08-12-2015, 11:20 AM
spremkishan Re: FIFO Based Receipt... 08-12-2015, 12:25 PM
excelliot Great.. mark this as solved. 08-12-2015, 01:36 PM
excelliot Re: FIFO Based Receipt... 08-15-2015, 05:09 AM
spremkishan Re: FIFO Based Receipt... 08-15-2015, 10:55 AM
excelliot upload sample file, with new... 08-15-2015, 11:46 AM
spremkishan Re: FIFO Based Receipt... 08-15-2015, 03:04 PM
excelliot Re: FIFO Based Receipt... 08-16-2015, 03:19 AM
spremkishan Re: FIFO Based Receipt... 08-16-2015, 04:23 AM
excelliot Re: FIFO Based Receipt... 08-17-2015, 05:06 AM
sparaguak Re: FIFO_Logic.xlsm 11-20-2019, 06:49 AM
JeteMc Re: FIFO Based Receipt... 11-22-2019, 08:27 PM
  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    5

    Question FIFO Based Receipt Adjustment To determine date when particular invoice is finally cleared

    Hi,

    I am trying to write a macro for getting payment date against each invoice.

    Eg:
    Invoice Date Inv Value Customer Code Inv_No
    1 Jan 15 100,0000 1 1

    Payment Detials of same customer
    payment Date Amt Customer code Paymentref
    2 Jan 15 950000 1 1
    5 Jan 15 5000 1 2

    In this case i want against first invoice clearing date as 5 jan 2015(since that is the date when the entire amount is cleared.)

    I have two sheets one sheet has Invoice details for all customers and other sheet has payment details for all customers.

    Logic: I want VBA to read each payment line item and then compare whether it belongs to the same customer and if it is then it will compare whether payment value is greater than invoice value if it is TRUE then it will allocate current payment date as clearing date to the invoice selected. Else it will calculate inv_bal and looping will be done to achieve clearing date of each line.

    Here is the code
    Sub fifoadjustment()
    Dim i, j As Integer
    Dim payment_bal, invoice_bal As Integer
    
    payment_bal = 0
    invoice_bal = 0
    
    For i = 1 To 22
    For j = 1 To 5
    
    payment_bal = Sheets(2).Range("i" & j + 1).Value
    invoice_bal = Sheets(1).Range("h" & i + 1).Value
    
    If payment_bal > invoice_bal Then
           Sheets(1).Range("I" & i + 1) = Sheets(2).Range("E" & j + 1)
        payment_bal = payment_bal - invoice_bal
        
        Else
        invoice_bal = invoice_bal - payment_bal
        
        End If
        
        Next j
        
        Next i
      
    End Sub
    Please help me out, it is not working and throwing Run time error '6' Overflow.


    Regards
    Prem
    Last edited by spremkishan; 08-12-2015 at 03:12 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Invoice Description items based on start and end date
    By Learning ExL in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2015, 11:38 AM
  2. [SOLVED] Automatic invoice charges based on date selection
    By Kym-B in forum Excel General
    Replies: 13
    Last Post: 11-21-2013, 01:07 PM
  3. Formula to determine due date based on hire date
    By tastjuste in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-17-2013, 06:59 PM
  4. [SOLVED] Make vlookup reset back to Name or blank after invoice is saved and cleared
    By jfolson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2013, 08:25 AM
  5. [SOLVED] Determine date based on request date meanwhile falls on particular days
    By Hikari in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-18-2013, 09:37 AM
  6. Replies: 4
    Last Post: 11-04-2012, 12:43 PM
  7. Date of Receipt based on In/OUT
    By cmcconna in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2010, 06:47 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