Results 1 to 2 of 2

How to delete Debits & credits off with a macro

Threaded View

  1. #1
    Registered User
    Join Date
    09-22-2014
    Location
    Nebrask
    MS-Off Ver
    2010
    Posts
    1

    How to delete Debits & credits off with a macro

    I have a recon I look at each month that has around 6,000 lines work of data. There are offsetting entries a negative and a po?itive. I have excel 2010 I would like a macro to delete all these entries. I found the below code but I cannot get it to work. I don't do much with macro's so am I doing something wrong when I am recording it.

    Private Sub doit_click()
        For x = 2 To Cells(Rows.Count, "B").End(xlUp).Row
            'Get the string to compare
            tacct = Cells(x, 2)
            tamt = Cells(x, 5)
            For x2 = x + 1 To Cells(Rows.Count, "A").End(xlUp).Row
                If Cells(x2, 2) = tacct And tamt + Cells(x2, 5) = 0 Then
                    Rows(x2).Delete
                    Rows(x).Delete
                    x = x - 1
                    Exit For
                End If
            Next    'x2
        Next    'x
    End Sub
    Last edited by alansidman; 09-22-2014 at 11:42 PM. Reason: code tags added

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] debits and credits in one column
    By childothe1980s in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-26-2013, 03:47 PM
  2. [SOLVED] Lookup Debits & Credits
    By Sniper in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2012, 10:25 AM
  3. Creating Macro to Hide offsetting debits and credits
    By lcarmack in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-02-2012, 05:07 PM
  4. Highlighting Debits and Credits
    By vharjani in forum Excel General
    Replies: 15
    Last Post: 02-23-2012, 02:20 PM
  5. [SOLVED] Change debits to credits
    By Yo in forum Excel General
    Replies: 1
    Last Post: 04-10-2006, 08:20 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