In my trial balance I put the the following code in to reflect the current balance or either a debit or a credit balance for the cash account that is on a separate sheet. How do I write a sub to use that same forumula but change to where it grabs the information for the accounts receivable sheet for example? It will take a long time if I keep adding accounts to the list and I have to manually enter in the code every time.
=IF(SUM(Cash!D4:D49)>SUM(Cash!E4:E49),SUM(Cash!D4:D49)-SUM(Cash!E4:E49), " " ) (Debit is greater than credit put it on the credit side of trial balance, the credit side is empty)
=IF(SUM(Cash!E4:E49)>SUM(Cash!D4:D49),SUM(Cash!E4:E49)-SUM(Cash!D4:D49), " ") (Credit is greater than debit so put it on the credit side of trial balance, the debit side is blank.)
[/URL] image host[/IMG]
=IF(SUM(Cash!D4:D49)>SUM(Cash!E4:E49),SUM(Cash!D4:D49)-SUM(Cash!E4:E49), " " ) (Debit is greater than credit put it on the credit side of trial balance, the credit side is empty)
=IF(SUM(Cash!E4:E49)>SUM(Cash!D4:D49),SUM(Cash!E4:E49)-SUM(Cash!D4:D49), " ") (Credit is greater than debit so put it on the credit side of trial balance, the debit side is blank.)