+ Reply to Thread
Results 1 to 38 of 38

Accounting Model (T Accounts)

  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Accounting Model (T Accounts)

    Hi,

    I have posted in the general forum (
    HTML Code: 
    ) and it was suggested I post here so here goes…

    What I require is a model which would take a data extract and post the line items to the correct account taking into account if it’s a debit or credit.

    The steps that are required would be:
    1. Identify all the unique GL accounts on the Data sheet column G
    2. Create a new sheet for each GL and include certain headings
    • Period
    • Recd
    • Trans.Date
    • Post.Date
    • Barcode
    • G/L Acct
    • Lennon_VAT
    • Sap_VAT
    • Ind.
    • Amount
    • Prof.Ctr
    • Cost Ctr


    3. Then assign each item on the data sheet to the correct account (and correct side of the account). I am unsure if it helps or not but each line item on the data sheet has a unique reference code (column C).

    If all works it should all balance back to zero.

    Can anyone help with a code please?
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    Here's code for what you've described:

    Please Login or Register  to view this content.
    *I added a Template sheet (hidden) so here's your file:T Accounts Header Split.xlsm
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    Oops, I forgot to tag the o/p

    Please Login or Register  to view this content.
    Last edited by xladept; 01-21-2015 at 08:16 PM.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,960

    Re: Accounting Model (T Accounts)

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ben Van Johnson

  5. #5
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    Hi,

    Thanks for helping with the codes here.

    @protonLeah - the debits/credits are on the wrong side. What part of the code do I need to change?

    @xladept - is there any way in which the data can be arrange so there are no blank rows in the T accounts (as in the attached examples)?

    A question for both is that when I have my actual data set on the "data" sheet it will have many many rows. Would I need to change anything or will it pick up the full range automatcially?

    One other question (and I know I am moving the goal posts slightly but this isnt as essiential). Can either code be adapted to acocunt for another data set? e.g. If I had a data2 tab (which would be in the same format) could it also account for that in the accounts with the only difference being it shades the font a different colour, say red.
    Attached Images Attached Images

  6. #6
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    Any help on this or should I just be more patient?

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Accounting Model (T Accounts)

    Hello pauldaddyadams,

    I assume your chart of accounts in the General Ledger is similar to the following:

    0xxxxx - Accounts Receivable/ Cash
    1xxxxx - Assets, Property, Equipment
    2xxxxx - Accounts Payable/ Current and long term liabilities
    3xxxxx - Operating Revenues
    4xxxxx - Retained Earnings
    5xxxxx - Marketing expenses
    6xxxxx - Revenue
    7xxxxx - Cost of Goods Sold
    8xxxxx - Operating Expenses
    9xxxxx - Other Expenses

    Please make any changes needed to match your Chart of Accounts. This will make it easier to determine which side of the "T" account increases or decreases.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    Try this:

    Please Login or Register  to view this content.

  9. #9
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    Hi

    @xladept Thank you, the code works and it now is presented how I visioned.

    I have uploaded the working file but I have included a "Data2" sheet. Is there any way the code could be amended to include the 2nd data set but make it distingishable in the accounts? I know I am pushing my luck so tell me where to go if need be

    @Leith I believe they are all expense accounts (operating expenses) the side in which they go on has already been determined in the column L of the data
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    Arrrghh - I apolgise in advance...

    The data2 set that I need is in a completley different format to what I anticipated.

    The data2 sheet has individual rows with each row having to posting entries e.g. in the example the first row is £494.60, this needs to be debited to 213000 and credited to 500000

    I have highlighted in red what ideally I would like the code to perform.

    Are you ablt to help with this 2nd requirment please?
    Attached Files Attached Files
    Last edited by pauldaddyadams; 01-22-2015 at 06:19 PM.

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    Hey,

    Thanks for the rep, it put me "beyond"

    Try this:

    Please Login or Register  to view this content.

  12. #12
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    Hi,

    I have finally got the chance to view the code to run it! 

    I believe its close.

    Data 1
    I have tested this and it all appears in the correct account and correct side, great news!

    Data 2
    Some of the GL accounts in columns M and N on the “Data 2” sheet may be unique. Is there any way in which it could create these accounts if they don’t exist also?

    Other than that its looking really good! Thank you so much

    I am slightly nervous when I come to use this in my main model as I do not understand VB. On the data1 sheet I have approx. 200 lines and then Data 2 sheet I have over 7000!! Would there be anything I need to amend or be aware of?

  13. #13
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    Just the "data boxes" on your op sheets - do you want to preserve those borders?

    Meanwhile:

    Please Login or Register  to view this content.

  14. #14
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    This works - I have run it for the sample data for just data1 and data2 and it does the job. Thank you!

    Sorry, preserve what boxes? If its the formatting on the template sheet (which gets repliacted on a new sheet) then I would like to keep that. The template sheet on my actual model will contain loads more rows.

    The only other thing I would want preseved really is somewhere to have a list of the accounts (sheets) its created?

  15. #15
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    Please Login or Register  to view this content.
    Last edited by xladept; 01-23-2015 at 05:32 PM.

  16. #16
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    xladept, you have done it!

    This is excatly what I have described. I am going to spend the day tomorrow testing it all. I will soon know as it should all balance!

    I will make as solved tomorrow once I have tested it fully. I do have a formula driven version which is work in progress so I can use the two to test each other. Your version is lightening fast.

  17. #17
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    Hi Xladept

    I changed the "DATA" sheet slightly. In the main its the same but I shifted it along from orignally starting in column B to now starting in J.

    What part of the code needs amending - its so hard for a noobie to work out.

    I have uploaded an example file. In the example file your macro should create 40 different accounts and it will map approx 8000 transactions.
    Attached Files Attached Files

  18. #18
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    Hi,

    Wish you hadn't done that - but I believe that this reflects the necessary changes
    (I see that the GL Accounts sheet is gone):

    Please Login or Register  to view this content.
    *I can't test it because your formulas yield no viable results in the GL field

  19. #19
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Accounting Model (T Accounts)

    @xladept

    I've been following this Thread as I'm an old, retired CPA...having used thousands of T accounts in my day.

    I must say, I admire your restraint
    Wish you hadn't done that
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  20. #20
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    Thats strange as the model I have has GL acocunts. I have run it now - its a slow goer but progressing. I always knew it would take a while to create once run due to its complexity.

    Jaslake is right. I apoligize if this caused you a lot of effort. I was torn between posting or not - I didnt want to lose what you had created which I knew worked but by not posting it meant I couldnt use the code previously supplied. Had I known it was a lot of effort on your behalf I wouldnt have asked.

    I am honestly very gratful for all your help these last few days.

    I will post back once its finished calculating. My laptop isnt the best but its chugging along, its taken over 45mins at the moment.

  21. #21
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    I tried running this and had to abort after a few hours. I will run it over night and report back

  22. #22
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    Hi,

    Something is wrong - it shouldn't take that long!

    I tried it again and everything was there - it ran in about 8 minutes - I'm thinking of how to speed it up
    Last edited by xladept; 01-25-2015 at 03:36 PM.

  23. #23
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    Really - how on earth did it run in 8 mins? Do you think its because of my laptop spec?

    I am about to run it now but I am expecting it to take all night

  24. #24
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    It actually ran in 296.3164 time units, which is less than 5 minutes.

  25. #25
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    Strange - I have started running it around 1.5 hours ago and its still going.

    It does the first few sheets fine but then slows down when creating to last few sheets.

  26. #26
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    Did you get the e-mail? It ran without a hitch

    There are only 50 sheets all told??

  27. #27
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    I just replied to it thanks!

    Yes, only 50 sheets but its killing my machine. I have office 2010, its a Core i5 1.6ghz with 8gb of ram. It could only be my spec dont you think?

  28. #28
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    I have office 2010, its a Core i7 1.73ghz 1.73ghz with 4gb of ram on a 64 bit operating system.

    @ John - could you try this and let me know of the timing?

    Please Login or Register  to view this content.

  29. #29
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Accounting Model (T Accounts)

    @ xladept

    Sure, be happy to...have Family for dinner...be finished in about 45 minutes. Will you post a File with the Code embedded such that I don't need to recreate your environment?

  30. #30
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    Thanks John,

    The code is in Module 1.T Accounts Header Split - JASLAKE.zip


    Orrin

    Please Login or Register  to view this content.

  31. #31
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    Hi,

    So... I ran this overnight only to find out my laptop went into sleep mode! Arrrgghh!

    I have tested it from the file you sent me and it all appears to be working great!!

    If someone else could try the macro and see how long it takes to run that will be great...
    Attached Files Attached Files

  32. #32
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    Glad that it looks right!

    John said that he'd try it - maybe someone else will give it a whirl

  33. #33
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    I ran it on my old machine (a Pentium 4 @ 3 GHz with .896 G of ram) in compatibility mode it took 1043.141 time units (17+mins)

  34. #34
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Accounting Model (T Accounts)

    @ xladept

    Sorry I didn't get back to you last evening...slipped my mind after my Daughter and Grandson left.

    The Code took 492.3477 Seconds (8.20 minutes) to run on my 2.53 GHz Intel Core 2 Duo with 8 GB Memory.

  35. #35
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    @ John - Thanks a million, I owe you - any thoughts on why Mr. Adams can't run it??

  36. #36
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Accounting Model (T Accounts)

    Hi Paul

    I ran the Workbook you attached (procedure Sub PaulDaddyAdamsXXX) and it executed in about 8.5 minutes...

    Sorry Orrin...I have no ideas re: this
    any thoughts on why Mr. Adams can't run it??
    Last edited by jaslake; 01-26-2015 at 07:45 PM.

  37. #37
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Accounting Model (T Accounts)

    Hi,

    I am going to try this on a different work machine. They are the same spec so I will know if its a problem with my laptop or not.

    I will report back

  38. #38
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Accounting Model (T Accounts)

    I'm very curious to know whether any of my code is unviable

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Model : Two Stage Gordon Model
    By elaph in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-29-2014, 11:37 AM
  2. Please help, intricate subtotal for main accounts with many sub accounts!!
    By mitch_bossard in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-24-2013, 05:17 PM
  3. Create a model that will generate a column of numbers based on model parameters
    By tncanoeguy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-01-2013, 05:47 PM
  4. VBA with PivotTable Count of Accounts - Want to show Sum of Accounts
    By snake10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2008, 07:27 AM
  5. Accounts in excel
    By tr1cky in forum Excel General
    Replies: 4
    Last Post: 08-18-2008, 08:28 AM

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