Automatic Entry of the Date
- September 23rd, 2005
- Miscellaneous
Thanks to Sandro for providing this very useful little macro (Excel and Mac compatible) for YNAB 3.1.
Do you get sick and tired of typing in today’s date when entering transactions in the Register? This little macro will do the work for you. Here’s out to get it running:
- With YNAB open, press Alt+F11
- You’re now in the Visual Basic Editor. On the left side there is a pane called “Project - VBA Project” (if it’s not visible press Ctrl+r). Double-click on Sheet3 (Register)
- A white page will open to the right. There are two drop-down boxes at the top of the just-opened page. In the left drop-down box select Worksheet
- The right drop-down box should automatically say SelectionChange and you should see two lines that have automatically been entered: Private Sub Worksheet_Selection… and End Sub.
- In between these two lines, paste the following code:
If Target.Column = 3 Then
If Range("B" & Target.Row).Value = "" Then
Range("B" & Target.Row).Value = Now
End If
End If - Click the Save button in the Visual Basic Editor and close it.
Alright, you should be finished. Now give it a test drive. When you click on a blank “Category” cell, the “Date” cell to the left of it will be filled in with today’s date! Thanks again Sandro!

