Excel Debit (Dr) and Credit (Cr) Function First copy the code from the above-given link which will look like this. Paste the code into the notepad to remove all the formatting. Copy the code from the Notepad and go to Excel. In Excel go to View Tab. Select the Macros Dropdown and select view Macros.