+ Reply to Thread
Results 1 to 5 of 5

Settle credit notes by VBA

Hybrid View

  1. #1
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Settle credit notes by VBA

    Hi Omey,

    This is what I've got so far but were there any credit-debit matches in your sample?

    Sub Omey(): Dim f As Long, r As Long: f = 2
    GetCred:
    Do Until Range("F" & f) < 0 Or Range("F" & f) = ""
    f = f + 1: Loop
    If Range("F" & f) = "" Then Exit Sub
    GetDeb:
    r = 2: Do Until Range("A" & r) = Range("A" & f) And Range("F" & r) > 0: r = r + 1
    If Range("A" & r) = "" Then
    f = f + 1: GoTo GetCred: End If: Loop
    If Range("F" & r) >= Abs(Range("F" & f)) Then
    Range("F" & r) = Range("F" & r) + Range("F" & f)
    Range("F" & f).EntireRow.Delete Shift:=xlUp
    Else: Range("F" & f) = Range("F" & r) + Range("F" & f)
    GoTo GetDeb: End If
    GoTo GetCred
    End Sub
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  2. #2
    Registered User
    Join Date
    08-15-2014
    Location
    Zurich
    MS-Off Ver
    2007
    Posts
    3

    Re: Settle credit notes by VBA

    hi,

    Thanks a lot for your help.

    Could you please explain me the steps you do in the macro?

    When I run it, it takes hours and never stops..

  3. #3
    Registered User
    Join Date
    08-15-2014
    Location
    Zurich
    MS-Off Ver
    2007
    Posts
    3

    Re: Settle credit notes by VBA

    hi,

    Thanks a lot for your help.

    Could you please explain me the steps you do in the macro?

    When I run it, it takes hours and never stops..

+ 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. Using Macro to separate credit term and non credit term
    By gingank in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2012, 02:22 AM
  2. end notes, foot notes and an Index Table
    By thadacto in forum Word Formatting & General
    Replies: 1
    Last Post: 12-27-2011, 06:22 PM
  3. Replies: 1
    Last Post: 05-13-2007, 12:16 PM
  4. Invoice and Credit Notes
    By craig in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-16-2005, 02:06 PM
  5. [SOLVED] Invoice and Credit Notes
    By craigoutinoz@hotmail.com in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-01-2005, 10:06 AM

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