Report Generator

BukiSP84

New Member
Joined
Sep 9, 2021
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hello! I am currently working on an Excel workbook that may be able to produce financial reporting templates, based on the data taken from the contract.
Namely, not all contracts are the same. Most of them differ in budgets, many of them in a number of reports etc.
To accomplish my task, I have inputs sheets. Resulting from input sheets, parameter sheets are created.
I've managed to code many of them. Now, I am stuck with the reporting template, itself.
So far, doing good. Now, I face a challenging need to have a couple of nested for each statement. I don't see other way around, considering my VBA knowledge.

What is your approach in a similar situation? Do you call individual macros, or put everything into one?
Calling individual macros would resolve my problems. However, I am pretty much lazy about resetting.

Aside of defining global variables and constants, is there a way to set values applicable for all modules & sheets?

For example:

Dim InputSheet as Worksheet
Set InputSheet = Worksheets ("InputSheet")

for all modules & worksheets to be implemented, not to reiterate sub by sub?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Your question is a bit high-level/generic, so I don't know how much this will help, but here goes.
Typically, when I have large projects with a lot of code and a lot of repitition, I like to break my code into numerous, smaller sub procedures.
In the interest of keeping things generic and dynamic, so I can easily re-use my code, I will often use parameters that I can pass to the sub-procedures.
(If you find yourself creating multiple similar sub procedures, that is usually a sign that you can change your approach to just using one sub procedure for that part and pass in the changing values that you need).

Here is a good link on doing that (note that "parameters" are also often called "arguments"):
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top