• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Improve Macro It is also posted on https://www.mrexcel.com/forum/excel-questions/1095997-improve-vba.html

Hello,

would you please improve the macro? The issue arises when I have numbers in both columns (A and B) in Debit and Credit.
For example In Debit 1,000 and in Credit 1,200. So, in column A should be (200) after running a Macro.
Code:
Sub MoveCredits_v3()
  With Range("A2:A" & Range("B" & Rows.Count).End(xlUp).Row)
    .Value = Evaluate(Replace(Replace("if(#="""","""",if(#=0,-^,#))", "#", .Address), "^", .Offset(, 1).Address))
    .Offset(, 1).Clear  '<- Optional to clear Credit column
  End With
End Sub
 
Last edited by a moderator:
Back
Top