+ Reply to Thread
Results 1 to 11 of 11

Receipts issued and record of payments

  1. #1
    Registered User
    Join Date
    08-17-2012
    Location
    Standerton South Africa
    MS-Off Ver
    Excel 2003
    Posts
    6

    Receipts issued and record of payments

    I use a template in workbook “Record of payments” to issue receipts, no problem there, but to make life easier I want to:

    1. Open the debtor’s account (workbook) in the folder named “Debtors” (let’s say account
    LEK-157) entered in range F7 of the template. “Record of payments” and the folder
    (“Debtors”) with the debtor’s accounts are in the same main folder named “Office”;

    2. Transfer the date, receipt number and amount paid from the receipt template to the next
    available row of LEK-157’s worksheet named “Payments received” (date column A, receipt
    number column B and amount column C);

    In LEK-157’s “Payments received”-worksheet the amount paid is divided between capital (column D), interest (column F) and commission (column G) - no problem.

    3. Copy the the row with date, receipt number, amount, capital, interest and commission paid
    from LEK-157 to the next available row in “Record of payments”- workbook’s worksheet
    named “Daily payments”. The columns of “Daily payments” are identical to the columns of
    the debtor’s account’s “Payments received”.

    4. Clear the template (no problem) and start with a receipt for account MAN-017 to repeat the
    process.

    At this moment steps 1, 2 and 3 are manually done.

    Your help will be much appreciated.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Receipts issued and record of payments

    Hello there,

    Try the following,

    Please Login or Register  to view this content.
    To use the code in your workbook:

    1. Press Alt+F8
    2. Clear the macro name field and replace it with OpenDebtorsWB
    3. Select the Create option
    4. Between the Sub OpenDebtorsWB and End Sub, copy and paste the above code
    5. Please take a minute to review the code
    Anything that appears in green is a comment, you will need to change parts of the code to fit your data. The comments will tell you when and how to do this.
    6. Exit out of Visual Basic
    7. Press Alt+F8, this time select he OpenDebtorsWB and select the Run option

    If you encounter and error on this line

    Please Login or Register  to view this content.
    Open a workbook in the Debtors folder and in an empty cell type =CELL("filename")
    this will reveal the path for you workbook's in this folder, replace the portion of the code highlighted in red with you workbook path less the filename

    Please Login or Register  to view this content.
    It should end up looking something like the following

    Please Login or Register  to view this content.
    Let me know if this works for you!

    Thanks!
    Last edited by rvasquez; 08-23-2012 at 01:00 PM.

  3. #3
    Forum Contributor thameem127's Avatar
    Join Date
    04-06-2012
    Location
    Jeddah,Saudi Arabia
    MS-Off Ver
    Excel 2003,Excel 2007
    Posts
    321

    Re: Receipts issued and record of payments

    Mr.rvasquez

    Please attach workbook so that i can understand how it works.
    Last edited by Cutter; 08-23-2012 at 12:30 PM. Reason: Removed double post

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Receipts issued and record of payments

    Hello there,

    Could you please attach a sample of you workbook and I will place the code in there? The way the code is set up it's running off your computers filepath. I suggest maybe opening LEK-157 and saving it to a created test folder or your desktop and also saving the template as a file in the same location. Then follow the steps above to add the code to your saved as template file and run it from there.

    Sorry thameem127, just realized you weren't the one to originally post the question. The way this code works is it's opening a file on your computer so it's a little hard to post an example file. Give me a second and I will try and create, two example files and tell you how to save them so you can test the code yourself.

    Thanks!
    Last edited by rvasquez; 08-23-2012 at 09:13 AM. Reason: wrong user

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Receipts issued and record of payments

    Hello thameem127,

    Attached are two example workbooks, that mimic Marianne's question.

    To see the code work, please do the following,

    1. Open each worksheet individually and then save the workbook as a Excel 97-2003 Workbook (*.xls)
    2. Please do not change the names of the workbooks.
    3. Close the JohnDoe workbook.
    4. On the thameem127(Master) workbook select cell B16 and copy and pastespecial values
    5. Select the cell and copy everything right of the last \
    6. Right click on the Run Macro button and then select View code
    7. Replace the red text in the following line of code in your code with the copied filepath from cell B16

    Please Login or Register  to view this content.
    8. Exit out of Visual Basic and make sure you are not in Design Mode
    9. click the Run Macro button and watch it work.

    10. Open the JohnDoe workbook to see what changes were made there.

    Let me know if you have any questions.

    Thanks!


    Sorry I just realized that I forget to attach the JohnDoe File. Here you go!
    Attached Files Attached Files
    Last edited by rvasquez; 08-24-2012 at 08:37 AM.

  6. #6
    Forum Contributor thameem127's Avatar
    Join Date
    04-06-2012
    Location
    Jeddah,Saudi Arabia
    MS-Off Ver
    Excel 2003,Excel 2007
    Posts
    321

    Re: Receipts issued and record of payments

    Thanks a lot Mr. rvasquez

  7. #7
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Receipts issued and record of payments

    No problem thameem127 let me know if that helps! And lol is Ms. Vasquez

  8. #8
    Registered User
    Join Date
    08-17-2012
    Location
    Standerton South Africa
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Receipts issued and record of payments

    RVasquez, thank you for your quick response to my problem.

    I followed your instructions but when I want to run the macro, I get the following message:

    Run-time error ‘1004’

    ‘C:\Users\Marianne\Documents\Another office\Debtors\.xls’ could not be found. Check spelling…….

    I found exactly the same path when I opened a debtor’s folder and typed in a cell =CELL(“filename”), as you suggested.

    I see there was also correspondence between you and thameem127. I tried to open the workbooks attached but was not able to - perhaps the attachment was meant for your eyes only?

    Thank you for your time, I really appreciate your help.

  9. #9
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Receipts issued and record of payments

    Switch the line of code that you updated to open a file to this:


    Please Login or Register  to view this content.
    and make sure that your files are saved with an xls extension not xlsm or anything else.

    The workbooks should be able to be opened, what kind of error do you get when trying to open them?

  10. #10
    Registered User
    Join Date
    08-17-2012
    Location
    Standerton South Africa
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Receipts issued and record of payments

    RVasquez, problem solved, it works just as I wanted it to! Thank you so much that you answered my query and for your help.

  11. #11
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Receipts issued and record of payments

    No problem, glad to help! Don't forget to mark this thread solved and maybe give a little star tap if I helped.

    Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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