+ Reply to Thread
Results 1 to 12 of 12

Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working

  1. #1
    Registered User
    Join Date
    02-09-2016
    Location
    Riverside, RI
    MS-Off Ver
    Vista
    Posts
    6

    Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working

    Hello Everyone,

    I will begin by admitting I am very new to VBA, but have been at it for months now trying to better myself.

    I am currently having some issues with getting my macro to act as a single journal entry (Sheet 2), where is will continuously post on the lines that are blank below the most recent entry. To list a few issues:
    1) ComboBoxes dont populate, unless I use a Command Button to populate the ComboBoxes
    2) the TextBoxes I have to the right of the UserForm are to pull the description of the account I am accessing - they remain blank indefinetely
    3) The posting itself does not process
    4) When I do populate my ComboBoxes (by the command button stated), it does not differentiate the accounts from what it originally placed in the 2nd ComboBox (Posting Account) and will actually list all accounts; Assets, Liabilities, Revenues, etc.

    I know my code is VERY sloppy, but any help towards a direction that I should be heading towards would be the greatest help ever! I have attached the excel workbook to this thread.


    WesRuss
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor spitfireblue's Avatar
    Join Date
    01-29-2015
    Location
    Adelaide, Australia
    MS-Off Ver
    2007,2010,2016
    Posts
    611

    Re: Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working

    Hi WesRuss,

    Without changing too much of your code, I have made a few changes to get you started.
    The main change is that Combo Box's 1 and 2 will initialize when the userform is activated using
    Please Login or Register  to view this content.
    ComboBox 3 will also be activated once a selection is made in ComboBox 2.

    User Form Example.xlsm

    Let me know how you go.

  3. #3
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working

    Hello WessRuss

    I've made a couple of changes to your code to make it work.
    I see you have 6 AddItem lists for ComboBox3. You'll have to change that to one list & change some of the codes. Either that or add more combo boxes or something.
    I haven't gone mad with changes, just enough so you can see how it works

    It's attached, see how it goes
    Cheers
    Phil

  4. #4
    Registered User
    Join Date
    02-09-2016
    Location
    Riverside, RI
    MS-Off Ver
    Vista
    Posts
    6

    Re: Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working

    Thank you both! The macro works perfectly now!

  5. #5
    Valued Forum Contributor spitfireblue's Avatar
    Join Date
    01-29-2015
    Location
    Adelaide, Australia
    MS-Off Ver
    2007,2010,2016
    Posts
    611

    Re: Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working

    Hi WesRuss,

    You may want to think about doing something like this that posts both the credit and debit at the same time.
    Also I have removed the excess text boxes as well and shortened the code.

    Copy of User Form Example.xlsm

  6. #6
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working

    Glad you're up & running, nothing worse then bashing your head against the wall lol

  7. #7
    Registered User
    Join Date
    02-09-2016
    Location
    Riverside, RI
    MS-Off Ver
    Vista
    Posts
    6

    Re: Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working

    I do like the double posting code as well - the only reason I was trying to stay away from that was for the cases where it wasnt just a two transactional posting, (Ex. labor costs)

    I had modified a good amount of the overall workbook - mainly display - and have run into a situation that I am just 100% unsure about hwo to proceed.

    I now need all transactions that I post each day transferred from the "General Journal" sheet to its accomodating GL. The format for teh GLs are ###.### - same as what you saw from the original lists.

    However, I do not wish to make a simple if then statement custom for each GL, but a universal code that matches column B and C with the GL worksheet name.

    Any idea what I should do with this? Attached is my most recent Excel.UserForm.xlsm

  8. #8
    Valued Forum Contributor spitfireblue's Avatar
    Join Date
    01-29-2015
    Location
    Adelaide, Australia
    MS-Off Ver
    2007,2010,2016
    Posts
    611

    Re: Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working

    Agreed...something like this should suffice. I have tried to use code that you are familiar with to make it easier for you.
    I have used a Do Until loop to loop through each line in the General Journal worksheet and copy the data to the relevant tab.

    Please Login or Register  to view this content.

  9. #9
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working

    Hi WessRuss
    Here is another option that copies & pastes to the worksheet determined by the account & sub account numbers. It will copy the entry to the target worksheet when Post is pressed. As it is now it will only work for sheets 010.400 to 010.430. Add the others to the Case part of the function
    Try it & see if it's what you're after

    Please Login or Register  to view this content.
    Last edited by Philb1; 02-11-2016 at 03:01 AM.

  10. #10
    Registered User
    Join Date
    02-09-2016
    Location
    Riverside, RI
    MS-Off Ver
    Vista
    Posts
    6

    Unhappy Re: Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working

    Thank you both again. I had tried both you scenarios and both have sent me back some errors.

    SpitFireBlue:

    Your code gives no errors, but does not copy any data to other sheets - not sure if I put the code in the wrong place

    Philb1:

    Your code is very complex - which is awesome - and I understand it all. The only issue is that I finished the Case Is sections, however the "Set TargetWs = ThisWorkbook.Sheets(ShtNum)" is coming back an error and always defaults to the error message, but will post the data in the "General Journal" correctly, but not copy.

    I have attached both options to this thread. SpitFireBlue - your code is in UserForm2, Philb1 - yours is in UserForm1.
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor spitfireblue's Avatar
    Join Date
    01-29-2015
    Location
    Adelaide, Australia
    MS-Off Ver
    2007,2010,2016
    Posts
    611

    Re: Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working


  12. #12
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Creating a Posting Journal Using VBA and UserForm - No Mechanics are Currently Working

    The macro was seeing 010 in column B as 10. This is now fixed.
    Excel VBA worksheet numerical order is determined by how they are set out on screen. Your macro data sheet although hidden, is sheet 1, general journal is sheet 2, 010.100 is sheet 3 etc. Sheets by numbers gives you the option to rename the sheets & it won't affect the macro. To prevent data being pasted to the wrong sheet I added a test for matching the sheet name determined by columns B&C on general journal ie 010.100, to the SheetNum variable in the Case statement. Bit hard to explain but hopefully you know what I mean.
    Try it & see
    Attached Files Attached Files
    Last edited by Philb1; 02-11-2016 at 06:31 PM. Reason: Help more if it's attached

+ 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. Automatic Posting Journal Entries to General edger using functions
    By victoramontoya in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-19-2015, 06:11 PM
  2. [SOLVED] Mechanics behind Rounddown formula
    By Sinep D in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-10-2015, 06:02 PM
  3. New To The Forum and Advanced Excel Mechanics
    By viveksnoop in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 03-11-2015, 04:14 PM
  4. Journal Entry with Posting to General Ledger and statement
    By moqree in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 08-21-2014, 05:51 AM
  5. Creating List of 25 "Journal" Entries Depending on data entered
    By tbonesmith66 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-03-2012, 05:08 PM
  6. LOOKUP mechanics
    By eolshenske in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-08-2009, 09:51 AM
  7. Creating a Journal
    By sentinela in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2009, 02:16 PM

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