+ Reply to Thread
Results 1 to 9 of 9

help write macro instead of formula summing and subtracting between debit & credit

  1. #1
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    292

    help write macro instead of formula summing and subtracting between debit & credit

    hello i try write macro in worksheet change event but doesn't work
    I would when e5 is filling value then should the formula dynamically like this from the firs time in f8=e5+d8-f8
    then should this formula in column f after rows 8 in column f
    f9=f8+d9-e9

    HTML Code: 
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: help write macro instead of formula summing and subtracting between debit & credit

    Are you sure about this?
    i would when e5 is filling value then should the formula dynamically like this from the firs time in f8=e5+d8-f8
    then should this fromula in column f after rows 8 in column f
    f9=f8+d9-e9
    If it suppose to be E8, then
    F7:
    =IF(COUNT($E$5,D8:E8)=3,E5+D8-E8,"")
    F8 to the last row that you want
    =IF(COUNT(G8,D9:E9)=3,G8+D9-E9,"")

    Or am I missing something?

  3. #3
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    292

    Re: help write macro instead of formula summing and subtracting between debit & credit

    yes I made mistake the formula in first time should f8=e5+d8-e8
    I don't need column g I write in it some notes by text the values in column d,e,f do you see the formula in my file in f8,9,10 the rests of the values in column f should the same thing like f9,10

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: help write macro instead of formula summing and subtracting between debit & credit

    Correction

    F8:
    =IF(COUNT(E5,D8:E8)=3,E5+D8-E8,"")

    F9: down
    =IF(COUNT(F8,D9:E9)=3,F8+D9-E9,"")

    Also E5:
    =IF(COUNT(B5:D5)=3,B5+C5-D5,"")

  5. #5
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    292

    Re: help write macro instead of formula summing and subtracting between debit & credit

    yes your formulas works perfectly , but as my post topic I would do that by macro I don't want pull down the formula every time I need it I would do that directly when put the values begins from d8:f I try writing code but i failed if you can do that I appreciate that

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: help write macro instead of formula summing and subtracting between debit & credit

    Still I don't understand why you need this though...
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    292

    Re: help write macro instead of formula summing and subtracting between debit & credit

    thanks very much for this code if it's possible I don't show the formula the idea I don't want press in cells contain formula may be happens some problem if mod the formula an I don't want protect the cells or formula
    and every time I have to unprotect to enter data that
    I would the code work every thing and if want you understand this way of account this way like account list bank follows the balance every process how changes

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: help write macro instead of formula summing and subtracting between debit & credit

    If you want to prevent user from changing the cells, you need to protect the sheet/cells anyway.

    Why not protect the sheet and lock only the cells with formula?
    In other words, unlock only the cells that you want user to edit?

  9. #9
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    292

    Re: help write macro instead of formula summing and subtracting between debit & credit

    you're extremely right ! just I thought may be way do that hide formula by code without using protecting
    many thanks for your assistance whether code or formula I would just understand the value 3 in formula may you explain me what means ?
    thanks again

+ 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. Formula To Match based on Date with Debit and credit amount
    By amitsahu in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-22-2020, 12:44 PM
  2. Debit&Credit
    By meytithveasna in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-20-2017, 09:57 AM
  3. Debit and Credit Columns Formula Needed
    By ryanb4614 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-31-2015, 03:53 PM
  4. [SOLVED] Debit/Credit Journal Formula
    By pauldaddyadams in forum Excel General
    Replies: 5
    Last Post: 01-23-2015, 04:14 PM
  5. debit-credit
    By tiki33 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-06-2014, 03:13 AM
  6. Replies: 4
    Last Post: 01-18-2014, 03:24 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