VBA Code to Populate Balance Sheet from Trial Balance Data

0 votes
I've read for a long time, but this is my first time posting. For a project I'm working on, I need to format Excel trial balance data into a "balance sheet."

Basically, I have the balance sheet template in another sheet and the trial balance data in one spreadsheet ("Data") ("Balance Sheet")

I must add information to the balance sheet from the ("Data") sheet ("Balance Sheet"). I can't seem to get my head around how to do this.

I have two macros: one that sums up each group of accounts, and the other that formats the trial balance data by account number (ex. all cash accounts are summed together on one line in the balance sheet). However, because this code is now hard coded to the data in the balance sheet, I am having difficulties making it reliable and adaptable. How can I make this code more adaptable so that it correctly populates? (for example, if I added another "cash" account to the cash group, it would add that amount to the "cash" line in the balance sheet)
Sep 23 in Others by Kithuzzz
• 20,660 points
84 views

1 answer to this question.

0 votes
It appears that what you need to do is construct an array for each sort of account, however, I haven't received your code yet. Let's assume you only have arrCash and arrLiability for the sake of simplicity. Then, you would insert each known GL code into the arrays. Alternatively, you may store a list of GL codes on a different spreadsheet. Now for the enjoyable part. Each code in your Excel spreadsheet would be compared to an element in your arrays using a looping algorithm. Add the amount to one of your variables if the comparison yields a true result. If the comparison returns false, write a program that redims the array to which the GL code must be placed before adding the GL code. Adding to the separate spreadsheet, for example. You would need to add that sum to the corresponding variable after adding the new gl code to the array. You would update your balance sheet with the results of the calculations after they were all finished.
answered Sep 24 by narikkadan
• 37,660 points

Related Questions In Others

0 votes
0 answers

How to handle large http response data from observer in Angular application to avoid browser crash?

Suppose we have a angular application which ...READ MORE

Apr 19, 2019 in Others by Hemant Gajbe
1,759 views
+2 votes
0 answers

Unable to return data to main function from promise

Hi, i am fairly new to node ...READ MORE

Sep 6, 2019 in Others by Muhammad Ahmed
• 140 points
249 views
0 votes
2 answers
0 votes
1 answer

How to import data from a HTML table on a website to excel?

Hello  To import any HTML file in excel there ...READ MORE

answered Feb 10 in Others by gaurav
• 22,040 points
297 views
0 votes
1 answer

Retrieve epay.info Balance with VBA and Excel

This code should log you in, provided ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,720 points
450 views
0 votes
1 answer

How to load file to Excel Power query from SFTP site

Currently, I don't think there is a ...READ MORE

answered Dec 3, 2018 in Power BI by Upasana
• 8,620 points
2,211 views
0 votes
1 answer

Using VBA Excel to create a gramatically correct list

The Excel AND function is a logical ...READ MORE

answered Feb 9 in Others by gaurav
• 22,040 points
68 views
0 votes
2 answers

How to copy a formula horizontally within a table using Excel VBA?

Hi so basically, create an adjacent column ...READ MORE

answered Feb 16 in Others by Edureka
• 13,640 points
202 views
0 votes
1 answer

Unable to import data in excel from another website using VB code

Replace : Set ieTable = ieDoc.all.Item("report-table") With: Set ieTable = ...READ MORE

answered Sep 21 in Others by narikkadan
• 37,660 points
66 views
0 votes
1 answer

Runtime error 438 while importing data in excel from secured website using VBA

Replace With ieDoc.forms(0) .userType.Value = "1" ...READ MORE

answered Sep 23 in Others by narikkadan
• 37,660 points
101 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP