Double Entry Credit/Debit Macro

MariosB

New Member
Joined
Feb 23, 2014
Messages
26
I am trying to set up a workbook where I can keep track of all my personal expenses by entering each transaction and then being registered to each account. In my workbook I have created 5 sheets (Sheet1= Transaction, Sheet2= GL, Sheet3= Bank Account, Sheet4= Cash, Sheet5= Monthly Exp). In Sheet1 (Transaction) I've created a command button that brings up a UserForm, where I have some fields for entering details about my transaction, where they appear as headings also in the other 4 Sheets (ColumnB= Date, ColumnC= Description, ColumnD= Account From, ColumnE= Account To, ColumnF= Debit, ColumnG= Credit).

Say I make two transactions. First I withdraw $100 from my Bank Account and then I go to the supermarket and spend the $100. What I am trying to achieve is the following:

1. When I make the first transaction (money withdrawal) and I press OK from the UserForm I want:
  • All the details from the UserForm to be transferred to Sheet2 (GL) under each respective column heading (Date, Description, Account From, Account To, Debit or Credit respectively)
  • At the same time Sheet3 (Bank Account) to be credited (i.e. subtracted) with $100 and Sheet4 (Cash) to be debited (i.e. added) with the $100.

2. When I make the second transaction (supermarket spending) and I press OK from the UserForm I want:


  • Again all the details from the UserForm to be transferred to Sheet2 (GL) under each respective column heading (Date, Description, Account From, Account To, Debit or Credit respectively)
  • At the same time Sheet4 (Cash) to be credited (i.e. subtracted) with $100 and Sheet5 (Monthly Exp) to be debited with the $100.

Finally, when I enter each transaction I want it to be added to the next empty row of each respective sheet. I hope this is not too confusing :)

I am including the code of the UserForm below:

Code:
Private Sub CancelButton_Click()


Unload Me


End Sub




Private Sub ClearButton_Click()


Call UserForm_Initialize


End Sub


Private Sub OKButton_Click()


End Sub


Private Sub UserForm_Initialize()


'Empty DateTextBox
DateTextBox.Value = ""


'Empty DescriptionTextBox
DescriptionTextBox.Value = ""


'Empty FromComboBox
FromComboBox.Clear


'Empty DebitTextBox
DebitTextBox.Value = ""


'Empty CreditTextBox
CreditTextBox.Value = ""


'Fill FromComboBox
With FromComboBox
    .AddItem "Bank Account"
    .AddItem "Cash"
    .AddItem "Monthly Exp"


'Empty ToComboBox
ToComboBox.Clear


'Fill ToComboBox
With ToComboBox
    .AddItem "Bank Account"
    .AddItem "Cash"
    .AddItem "Monthly Exp"
 
'Set debit as default
DebitOptionButton.Value = True
End With


End With
End Sub
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi, I need a similar excel workbook. Did you find a solution to your problem? Highly appreciated. Thanks
 
Upvote 0
Hi, I need a similar excel workbook. Did you find a solution to your problem? Highly appreciated. Thanks
MariosB has not logged in since 2017, so I doubt they are active on this board anymore.

If you have a question, it would probably be best to post it as a new question (in a new thread of your own).
That way it will appear in the "Unanswered threads" post that most people use to look for new unanswered questions.
 
Upvote 0
MariosB has not logged in since 2017, so I doubt they are active on this board anymore.

If you have a question, it would probably be best to post it as a new question (in a new thread of your own).
That way it will appear in the "Unanswered threads" post that most people use to look for new unanswered questions.
Understood. Thank you
 
Upvote 0

Forum statistics

Threads
1,224,829
Messages
6,181,218
Members
453,024
Latest member
Wingit77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top